home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Programming / Symantec C⁄C++ Defects Folder / Symantec C⁄C++ Defects < prev   
Encoding:
Text File  |  1993-10-05  |  170.2 KB  |  4,618 lines  |  [TEXT/KAHL]

  1.       Symantec Development Tools Public Defect List
  2.  
  3. This information may be read, copied, distributed, etc., by
  4. any means whatsoever, but it may not be modified in any way,
  5. and it remains the property of Symantec Corporation.
  6.  
  7. The following is a list of confirmed defects in THINK C 6.0.1,
  8. Symantec C++ for Macintosh 6.0.1 and Symantec C++ for 
  9. MPW 6.0.1.  
  10.  
  11. Please note that "THINK C/C++" is used to refer to THINK C 
  12. 6.0.1 and/or Symantec C++ for Macintosh 6.0.1.
  13. Generated Tuesday, October 5, 1993 2:15:27 PM
  14.  
  15. Copyright ©1993, Symantec Corporation. All rights reserved.
  16. ----------------------------------------------------------------------------
  17. ----------------------------------------------------------------------------
  18. Problem Area: Browser
  19. ----------------------------------------------------------------------------
  20.     Product: THINK C/C++
  21. ----------------------------------------------------------------------------
  22. ••Defect Number: 5848, THINK C/C++
  23.   Problem Area: Browser      Type: Incorrect Functionality
  24. If inlined functions with the same name are declared in multiple classes the browser will find
  25. the first inlined function in the file containing the class, not the one corresponding to the
  26. actual class chosen.
  27.  
  28. Workaround:
  29.  
  30. Use "Search Again" until the correct class containing the inline function is reached.  Outlining
  31. the functions in the source file during development also works.
  32. ----------------------------------------------------------------------------
  33. ••Defect Number: 5892, THINK C/C++
  34.   Problem Area: Browser      Type: Incorrect Functionality
  35. Unmangling is not properly done for pointers to pointers of undimensioned arrays.  This can be
  36. seen if the following file is added to a project and struct Y is viewed in the Browser:
  37.  
  38. struct X { };
  39. typedef X (*Xptr)[];
  40. struct Y {
  41.     void f(Xptr) { };
  42. };
  43. ----------------------------------------------------------------------------
  44. ••Defect Number: 6159, THINK C/C++
  45.   Problem Area: Browser      Type: Incorrect Functionality
  46. The browser won't go to the correct function if a class contains both an operator+ and operator+=
  47. overload, unless the operator+ implementation comes first in a source file. If operator+ is
  48. selected in the browser, operator +=  will come up instead. Same thing for -=. 
  49. ----------------------------------------------------------------------------
  50. ••Defect Number: 6178, THINK C/C++
  51.   Problem Area: Browser      Type: Incorrect Functionality
  52. The Browser has a maximum dimension which limits its ability to view a huge class tree in the
  53. Browser window, and the window can not be scrolled to the right.
  54. ----------------------------------------------------------------------------
  55. ----------------------------------------------------------------------------
  56. Problem Area: Compatibility
  57. ----------------------------------------------------------------------------
  58.     Product: THINK C
  59. ----------------------------------------------------------------------------
  60. ••Defect Number: 5579, THINK C
  61.   Problem Area: Compatibility      Type: Crash
  62. There is a problem with the THINK C Debugger interacting with the Japanese Input Method.
  63. If you switch to the Japanese Input Method for the first time while running a project in the
  64. Debugger, then the next time you switch to the Japanese Input Method in the running project you
  65. will get a System Error #25. 
  66.  
  67. Workaround:
  68.  
  69. Switch in and out of the Japanese Input Method BEFORE you run your program with the Think
  70. Debugger.
  71. ----------------------------------------------------------------------------
  72. ••Defect Number: 5799, THINK C
  73.   Problem Area: Compatibility      Type: Crash
  74. The THINK Debugger does not work with the Macintosh emulator "Spectre 3.0", which runs on the
  75. Atari ST computer series. 
  76. ----------------------------------------------------------------------------
  77. ••Defect Number: 5035, THINK C
  78.   Problem Area: Compatibility      Type: Crash
  79. Address errors occur with UUPC versions 3.0 and 3.1b26 if slot 27 is already in use when the
  80. .console driver is loaded. If the .console driver is loaded in slot 27 it's ok. 
  81. ----------------------------------------------------------------------------
  82. ••Defect Number: 2642, THINK C
  83.   Problem Area: Compatibility      Type: Incorrect Functionality
  84. The DA Shell.c file contains a call to Launch, which is no longer supported in THINK C.   The
  85. code could be rewritten to use _Launch.  As is, the project does not link. The DA shell project
  86. is provided as an application and does not require rebuilding to work as directed.
  87.  
  88. Workaround:
  89.  
  90. The DA shell project is provided as an application and does not require rebuilding. The source
  91. code is provided as a historical curiosity.
  92. ----------------------------------------------------------------------------
  93.     Product: THINK C/C++
  94. ----------------------------------------------------------------------------
  95. ••Defect Number: 6181, THINK C/C++
  96.   Problem Area: Compatibility      Type: Crash
  97. There's a incompatibility with the Think Debugger and the Stylewriter II  driver.  While running
  98. the TCL 'Tiny Edit' demo program in the debugger, with a breakpoint set in the function:
  99.  
  100.          void CEditDoc::BuildWindow (Handle theData)
  101.   on the line:
  102.  
  103.  ->        if (theData)
  104.                theMainPane->SetTextHandle(theData);
  105.  
  106. When the debugger hits the breakpoint, an illegal instruction error occurs.  
  107.  
  108. Workaround:
  109.  
  110. The problem goes away if  users "unchoose" the Stylewriter II driver.  
  111. ----------------------------------------------------------------------------
  112. ••Defect Number: 4408, THINK C/C++
  113.   Problem Area: Compatibility      Type: Incorrect Functionality
  114. The extended syntax feature for #pragma parameter is currently not supported.  Example:
  115. #pragma parameter foo(__D0)
  116. pascal void foo(Size byteCount)
  117.     = 0xA000;
  118.  
  119. only compiles under THINK C if the number of parameters (__D0) matches the number of actual
  120. parameters reflected in the passed parameter list.  If the count doesn't match, THINK C flags it
  121. as an error.
  122. What MPW C does is pass whatever parameters are left after the register based ones have been
  123. assigned, on the stack. For example:
  124.  
  125. #pragma parameter foo(__D0, __A0)
  126. pascal void foo(Size byteCount, Ptr blahPtr, long fi)
  127.     = 0xA000;
  128.  
  129. D0 = byteCount
  130. A0 = blahPtr
  131. push on to stack = fi
  132. ----------------------------------------------------------------------------
  133.     Product: Symantec C/C++ for MPW
  134. ----------------------------------------------------------------------------
  135. ••Defect Number: 6182, Symantec C/C++ for MPW
  136.   Problem Area: Compatibility      Type: Incorrect Functionality
  137. Not all libraries built with MPW C are supported by Symantec C/C++ for MPW. This is because MPW C
  138. passes all function arguments as longs, while Symantec C/C++ for MPW only does this for
  139. unprototyped functions.  
  140.  
  141. Workaround:
  142.  
  143. Use Pascal calling conventions for all functions.
  144. ----------------------------------------------------------------------------
  145. ----------------------------------------------------------------------------
  146. Problem Area: C Compiler
  147. ----------------------------------------------------------------------------
  148.     Product: THINK C
  149. ----------------------------------------------------------------------------
  150. ••Defect Number: 4866, THINK C
  151.   Problem Area: C Compiler      Type: Crash
  152. Code generation problem with the C compiler. This INIT code sets up a patch to GetNextEvent, and
  153. solves the problem of keeping track of the global variables by poking in the address of the data
  154. it will need when it gets invoked. 
  155.  
  156. lea     globalstruct, a0        ; this is my data I need to access
  157. move.l  a0, set_addr+2          ; set_addr points to an instruction:
  158.                                 ; set_addr: move.l #0x12345678, -(sp)
  159. move.l  #_GetNextEvent, d0      ; put the trap number in d0
  160. GetTrapAddress                  ; and get its address
  161.  
  162. "Disassemble" says:
  163.  
  164. 000000FE        LEA       $0000(A4),A0
  165. 00000102        MOVE.L    A0,$0002(A4)
  166. 00000106        MOVE.L    #$0000A970,D0
  167. 0000010C        DC.W      $A146          ; OS 0046
  168.  
  169. This looks ok -- the reference to globalstruct assembles as an (as yet unknown) offset from a4
  170. and the address to store into assembles as an (as yet unknown) offset+2 from a4.
  171.  
  172. However, the actual code output is this, which bombs:
  173.  
  174. +00FE  000BEA  LEA     $1A9C(A4),A0                         | 41EC 1A9C
  175. +0102  000BEE  MOVE.L  set_addr+$0002,$203C(A4); 00000AD8   | 297A FEE8 203C
  176. +0108  000BF4  ORI.B   #$A970,D0           ; 'p'            | 0000 A970
  177. +010C  000BF8  _GetTrapAddress             ; A146           | A146
  178.  
  179. The linker has evidently patched in the correct address (set_addr+$0002) but has patched it in
  180. over the source operand instead of the destination operand, resulting in the next instruction
  181. getting overwritten.
  182. ----------------------------------------------------------------------------
  183. ••Defect Number: 2692, THINK C
  184.   Problem Area: C Compiler      Type: Incorrect Functionality
  185. THINK C may produce incorrect code when an array subscript contains an arithmetic expression with
  186. large numbers.  For example:
  187.      
  188.           char globalArray;
  189.           char array[30000];
  190.           
  191.           foo()
  192.           {
  193.                int i=25000;
  194.                int j;
  195.                char c;
  196.                
  197.           // This may fail depending on global data configuration:
  198.                c=globalArray[i-24000];
  199.           }
  200.  
  201. Workaround:
  202.  
  203. Assigning the expression to a temporary variable and using the temporary variable as the
  204. subscript will always work. For the example above:
  205. j=i-24000;
  206. c=globalArray[j];
  207. ----------------------------------------------------------------------------
  208. ••Defect Number: 5310, THINK C
  209.   Problem Area: C Compiler      Type: Incorrect Functionality
  210. Code motion optimization bug in Think C can cause crashes, as seen with this example:
  211.  
  212. void main(void)
  213. {
  214.    int i;
  215.    Boolean **aa;
  216.  
  217.    aa = (Boolean **)0x00000000;
  218.    for (i = 5; i--; ) {
  219.    if (aa && (**aa)) break;
  220.    }
  221. }
  222.  
  223. The double dereference of the handle (**aa) occurs outside the loop even though the dereference
  224. normally should be prevented from happening by the short circuit evaluation. 
  225.  
  226. Workaround:
  227.  
  228. Turn off code motion optimization.
  229. ----------------------------------------------------------------------------
  230. ••Defect Number: 5767, THINK C
  231.   Problem Area: C Compiler      Type: Incorrect Functionality
  232. There is a codegen bug with ternary operator in THINK C involving integer constants.
  233. f should push 2 bytes of zeros on the stack. It incorrectly pushes 4 bytes.  Other variants and
  234. ternary arguments which are non-constant work correctly.
  235.  
  236. void f(short);
  237. void main()
  238. {
  239.     f(0 ? 1L : 0);
  240. }
  241. /*
  242. main:
  243. 00000006: 42A7               CLR.L     -(A7)
  244. 00000008: 4EAD 0000          JSR       f
  245. 0000000C: 5C8F               ADDQ.L    #$4,A7
  246. 0000000E: 4E75               RTS
  247. 00000010
  248. */
  249.  
  250. Workaround:
  251.  
  252. Use the L specifier as in:
  253. f(0 ? 1L : 0L);
  254. ----------------------------------------------------------------------------
  255. ••Defect Number: 4431, THINK C
  256.   Problem Area: C Compiler      Type: Incorrect Functionality
  257. THINK C erroneously assembles the completely illegal (and nonsensical) instruction: 
  258.  
  259.         MOVEM.L #0x12345678,A0
  260. into
  261.         4CFC 0100 1234
  262.  
  263. when it should instead identify it as illegal code.
  264. ----------------------------------------------------------------------------
  265. ••Defect Number: 4914, THINK C
  266.   Problem Area: C Compiler      Type: Incorrect Functionality
  267. Code gen bug in Think C :
  268.  
  269. #define XX 16
  270. #define YY (1L << 16)
  271.  
  272.    if (XX * XX * 256 <= YY)
  273.        Debugger();
  274.  
  275. Generates an illegal instruction. This is what the Think Disassemble command says:
  276.  
  277. 00000000: 0CBC 0001 0000     CMPI.L    #$00010000,#$0000
  278.                   0000           
  279. 00000008: 0000 6E02               ORI.B     #$6E02,D0
  280. 0000000C: A9FF                        _Debugger
  281. 0000000E: 4E75                        RTS
  282. 00000010
  283. ----------------------------------------------------------------------------
  284.     Product: THINK C/C++
  285. ----------------------------------------------------------------------------
  286. ••Defect Number: 5923, THINK C/C++
  287.   Problem Area: C Compiler      Type: Crash
  288. Code motion in THINK C compiler will crash optimizing the following construct:
  289.  
  290. int f ();
  291. int k1;
  292.  
  293. g( )
  294. {
  295.     do {} while (0);
  296.     do {} while (0);
  297.   do {} while (0); //must be three or more do..whiles, or for(;;).
  298.     k1 = f() +1;     //expression involving a function call
  299. }
  300.  
  301. Workaround:
  302.  
  303. Turn off code motion.
  304. ----------------------------------------------------------------------------
  305. ••Defect Number: 5933, THINK C/C++
  306.   Problem Area: C Compiler      Type: Crash
  307. The THINK C compiler will hang compiling function calls that require very large stack space as in
  308. the following construct.  It should instead produce the error "code overflow".
  309.  
  310. struct m
  311. {
  312.     long [100][100];
  313. } *pm;
  314.  
  315. main()
  316. {
  317.     s(*pm);//attempt to pass 40k on the stack
  318. }
  319. ----------------------------------------------------------------------------
  320. ••Defect Number: 4702, THINK C/C++
  321.   Problem Area: C Compiler      Type: Incorrect Functionality
  322. In the THINK C translator, there are deficiencies with the treatment of character constants.  The
  323. ANSI standard states that character constants are allowed to be of any length, and that their
  324. value if larger or longer than a character in the execution environment is implementation
  325. defined.
  326. The translator should not produce a diagnostic, since according to the standard it does not
  327. matter what value is produced.  The THINK C translator does not accept the following:
  328.  
  329. int i = '1234567';      /* "Only 1,2, and 4 byte characters allowed" diagnostic */
  330. int j = '\x354';        /* "Escape sequence does not fit into a byte" diagnostic */
  331. ----------------------------------------------------------------------------
  332. ••Defect Number: 4703, THINK C/C++
  333.   Problem Area: C Compiler      Type: Incorrect Functionality
  334. The THINK translator does not allow the re-declaration of a static function inside the scope of
  335. another function.
  336. ----------------------------------------------------------------------------
  337. ••Defect Number: 5681, THINK C/C++
  338.   Problem Area: C Compiler      Type: Incorrect Functionality
  339. The inline assembler cannot resolve more than one member reference at a time when specifying an
  340. address offset. For example:
  341.  
  342.     struct X {
  343.         struct Y {
  344.             short i;
  345.         } y;
  346.     };
  347.     
  348.     typedef struct X X;
  349.     
  350.     void main()
  351.     {
  352.         asm {
  353.             move.w X.y.i(a0), d0            // Error:   value has no members
  354.         }
  355.     }
  356.  
  357. Workaround:
  358.  
  359. Use the OFFSET() macro defined in asm.h, eg:
  360. move.w OFFSET(X,y.i)(a0), d0
  361. ----------------------------------------------------------------------------
  362. ••Defect Number: 6023, THINK C/C++
  363.   Problem Area: C Compiler      Type: Incorrect Functionality
  364. The following macro and invocation are allowed by THINK C:
  365.  
  366. #define Macro(a)    void foo(a);
  367.  
  368. main() {
  369.     Macro()
  370. }
  371.  
  372. The ANSI standard (Section 3.8.3) disallows empty argument lists.
  373.  
  374. ----------------------------------------------------------------------------
  375. ••Defect Number: 6045, THINK C/C++
  376.   Problem Area: C Compiler      Type: Incorrect Functionality
  377. Using the MAXFLOAT macro in values.h will produce the error message 'Second argument to function
  378. "nextfloat" does not match prototype' with the factory settings for THINK C. nextfloat() expects
  379. an extended type as its second argument, while MAXFLOAT passes 0.0, which cannot be converted
  380. correctly.
  381.  
  382. Workaround:
  383.  
  384. Turning on native floating point format will solve the problem: extended == double when this
  385. option is turned on, and as such the conversion can be made.
  386. ----------------------------------------------------------------------------
  387. ••Defect Number: 6049, THINK C/C++
  388.   Problem Area: C Compiler      Type: Incorrect Functionality
  389. The static function dtof() in the ANSI library source file scanf.c does not correctly save the
  390. floating point environment, resulting in the 68881 floating-point control register being munged
  391. during the call.
  392.  
  393. Workaround:
  394.  
  395. The bug can be repaired by modifying the function dtof() in scanf.c as follows:
  396. 1) introduce a new local short named expc1
  397. 2) assign expc1 to the value of expc after the call fp68k(&expc,FPROCENTRY)
  398. 3) Add the function call "fp68k(&expc1,FPROCEXIT)" after the label done.
  399. ----------------------------------------------------------------------------
  400. ••Defect Number: 5237, THINK C/C++
  401.   Problem Area: C Compiler      Type: Incorrect Functionality
  402. The register coloring global optimization generates incorrect code in the following snippet:
  403.  
  404. ...
  405.    else if (pattern[state] == *theText)
  406.    Put (theQue, next1[state]); // **** Error: state has to be set == *theText
  407.    else if (pattern[state] < 0)
  408. ...
  409. ----------------------------------------------------------------------------
  410. ••Defect Number: 6189, THINK C/C++
  411.   Problem Area: C Compiler      Type: Incorrect Functionality
  412. Compiling the following with Think C with code motion and CSE elimination on produces an internal
  413. error:
  414.  Message:
  415.     internal compiler error 208:184
  416.  
  417. code is:
  418.  
  419. static void optimize_bug( short i )
  420. {
  421.    while( TRUE )
  422.    {
  423.    if( ( i & 3 ) != 0 )
  424.    {
  425.    switch( i & 3 )  // halts here
  426.    {
  427.    case 1:
  428.    break;
  429.    }
  430.    }
  431.    }
  432. }
  433.  
  434.  
  435. Workaround:
  436.  
  437. switch( 3 & i ) works. Assigning the sub-expression to a local variable also works.
  438. ----------------------------------------------------------------------------
  439.     Product: Symantec C/C++ for MPW
  440. ----------------------------------------------------------------------------
  441. ••Defect Number: 4864, Symantec C/C++ for MPW
  442.   Problem Area: C Compiler      Type: Incorrect Functionality
  443. The ANSI C Standard states:
  444. "The string literal of a #line (if present) shall not be a 'wide-char'string", (ANSI C Standard,
  445. section 3.8.4)
  446. The SC compiler does not flag this error in the following source code, even when using the -A
  447. switch to enforce ANSI compatibility.
  448.  
  449. int main ()
  450. {
  451.     #line 9999 L"c38.c"  /* should be an error */
  452.     return 0;
  453. }
  454. ----------------------------------------------------------------------------
  455. ••Defect Number: 4908, Symantec C/C++ for MPW
  456.   Problem Area: C Compiler      Type: Incorrect Functionality
  457. The ANSI C Standard states "If an identifier declared with internal linkage is used in an
  458. expression (other than as a part of the operand of a sizeof() operator), there shall be exactly
  459. one external definition for the identifier in the translation unit." (ANSI C Standard 3.7).
  460. The SC compiler does not flag this error in the following source code, even when the -A switch is
  461. used to enforce ANSI compatibility.
  462.  
  463. static int f1();
  464. F2() { f1();}   /* should be an error */
  465.  
  466. ----------------------------------------------------------------------------
  467. ••Defect Number: 4929, Symantec C/C++ for MPW
  468.   Problem Area: C Compiler      Type: Incorrect Functionality
  469. The ANSI C Standard states "A translation-unit must contain at least one external definition."
  470. (ANSI C Standard 3.7). The SC compiler does not flag this error in the following source code,
  471. even when the -A switch is used to enforce ANSI compatibility.
  472.  
  473. /*This file contains nothing but comments*/
  474. /*it should produce an error when compiled */
  475. ----------------------------------------------------------------------------
  476. ••Defect Number: 4946, Symantec C/C++ for MPW
  477.   Problem Area: C Compiler      Type: Incorrect Functionality
  478. The ANSI C Standard states "An assignment operator shall have a modifiable lvalue as its left
  479. operand."  (ANSI C Standard 3.3.16).
  480. The SC compiler compiles the following source code without producing an error,  even using the -A
  481. switch to enforce ANSI compatibility.
  482.  
  483. int main ()
  484. {    
  485.     struct x{
  486.         int i;
  487.         };
  488.     struct x fx();
  489.     fx().i = 0;  /* should be an error: lvalue required */
  490.     return 0;
  491. }
  492. ----------------------------------------------------------------------------
  493. ••Defect Number: 4948, Symantec C/C++ for MPW
  494.   Problem Area: C Compiler      Type: Incorrect Functionality
  495. With regard to array subscripting, the ANSI C Standard states "One of the expressions shall have
  496. type 'pointer to object type', the other shall have integral type... " (ANSI C Standard 3.3.2.1).
  497.  A non-lvalue array does not convert to a pointer.
  498. The SC compiler compiles the following source without producing an error, even using the -A
  499. switch to enforce ANSI compatibiliy. 
  500.  
  501. int main ()
  502. {
  503.     struct x {char a[4];} f();
  504.     int i;
  505.     i = f().a[10];  /* should be an error */
  506.     return 0;
  507. }
  508. ----------------------------------------------------------------------------
  509. ----------------------------------------------------------------------------
  510. Problem Area: SymC++ Compiler
  511. ----------------------------------------------------------------------------
  512.     Product: THINK C/C++
  513. ----------------------------------------------------------------------------
  514. ••Defect Number: 5646, THINK C/C++
  515.   Problem Area: SymC++ Compiler      Type: Crash
  516. Runtime crash occurs with a program setting up a multiple inheritance hierarchy such as the
  517. following:
  518.  
  519. class A {
  520. public:
  521.         A() { }
  522.         virtual ~A() {      
  523.         }
  524. };
  525.  
  526. class Aa : public virtual A {
  527. public:
  528.         Aa() { }
  529.         ~Aa() { 
  530.         }
  531. };
  532.  
  533. class B : public virtual A {
  534. public:
  535.         B() { }
  536.         ~B() { 
  537.         }
  538. };
  539.  
  540. class Bb : public virtual Aa, public B {
  541. public:
  542.         Bb() { }
  543.         ~Bb() { 
  544.         }
  545. };
  546.  
  547. void main( void )
  548. {       
  549.         A  *ap;
  550.         
  551.         ap = new Bb;
  552.         delete ap;
  553. }
  554. ----------------------------------------------------------------------------
  555. ••Defect Number: 5653, THINK C/C++
  556.   Problem Area: SymC++ Compiler      Type: Crash
  557. Compiling the following function with any precompiled header that contains memory.h :
  558.  
  559.    void Zone()
  560.    {
  561.    }
  562.  
  563. gives Error:   internal error: file ph.c line 252
  564.  
  565. Workaround:
  566.  
  567. Change the name of the function to something other than "Zone"
  568. ----------------------------------------------------------------------------
  569. ••Defect Number: 5658, THINK C/C++
  570.   Problem Area: SymC++ Compiler      Type: Crash
  571. The following code generates an internal error in out.c line 460.c.  
  572.  
  573. // Almost any variation corrects the anomaly.
  574.  
  575. class first { public: virtual void vf(); };
  576. class second : public virtual first { public: void vf(); }; 
  577. class third : public second { public: ~third();};
  578. class fourth : public third { public: void method(); };
  579. void fun() { fourth * s = new fourth(); }
  580.  
  581. Workaround:
  582.  
  583. The easiest is to make first a non-virtual base of second.
  584. ----------------------------------------------------------------------------
  585. ••Defect Number: 5843, THINK C/C++
  586.   Problem Area: SymC++ Compiler      Type: Crash
  587. An internal error "CGCntrl, line 58" is generated if a method needs to convert an unsigned int to
  588. a floating point return type and is followed by something else that generates code.
  589.  
  590. unsigned b;
  591. struct softball { double f(void);};
  592.  
  593. double softball::f(void)
  594. { return  b;};
  595.  
  596. void vf(void){};
  597.  
  598. Workaround:
  599.  
  600. double softball::f(void)
  601. { double d=b; return  d;};
  602. ----------------------------------------------------------------------------
  603.     Product: THINK C/C++, Symantec C/C++ for MPW
  604. ----------------------------------------------------------------------------
  605. ••Defect Number: 5854, THINK C/C++, Symantec C/C++ for MPW
  606.   Problem Area: SymC++ Compiler      Type: Crash
  607. The following code produces a correct error message, followed by an internal error in init.c line
  608. 235.
  609.  
  610. const int x = 1;
  611. const int x = 1;    // Error:   'x' is already defined
  612.                     
  613. ----------------------------------------------------------------------------
  614. ••Defect Number: 5910, THINK C/C++, Symantec C/C++ for MPW
  615.   Problem Area: SymC++ Compiler      Type: Crash
  616. The compiler generates an internal error when trying to expand an inline function that contains
  617. an initialization to a stack-based local array:
  618.  
  619. inline void f()
  620. {
  621.     char s[] = "anything";
  622. }
  623. void main()
  624. {
  625.     f();        // internal error: file cpp.c line 845  
  626. }
  627.  
  628. Workaround:
  629.  
  630. Rewriting the code to use a pointer instead of an array works fine.
  631. ----------------------------------------------------------------------------
  632. ••Defect Number: 5912, THINK C/C++, Symantec C/C++ for MPW
  633.   Problem Area: SymC++ Compiler      Type: Crash
  634. This test case causes the compiler to crash with a bus error, and if each occurrence of "class"
  635. is replaced by "struct", the same behavior results:
  636.  
  637. class A { enum {FALSE, TRUE}; };
  638. class B { enum {FALSE = 1, TRUE}; };
  639. class C : A, B { };
  640. int main()
  641.     {
  642.     int c = C::FALSE;
  643.     return &c != 0;
  644.     }
  645. ----------------------------------------------------------------------------
  646.     Product: THINK C/C++
  647. ----------------------------------------------------------------------------
  648. ••Defect Number: 6041, THINK C/C++
  649.   Problem Area: SymC++ Compiler      Type: Crash
  650. Compiling this file with C++ will produce a bus error when the "Strings in code segment" option
  651. is turned on:  
  652.  
  653. void f(unsigned char * , unsigned long );
  654. void g( void )
  655. {
  656.     f("\pThis is a string", "\pThis is a string"[0]+1);
  657. }
  658.  
  659. Workaround:
  660.  
  661. Turn off "put strings in code" option
  662. ----------------------------------------------------------------------------
  663.     Product: THINK C/C++, Symantec C/C++ for MPW
  664. ----------------------------------------------------------------------------
  665. ••Defect Number: 6174, THINK C/C++, Symantec C/C++ for MPW
  666.   Problem Area: SymC++ Compiler      Type: Crash
  667. The C++ compiler will generate an incorrect opcode when it compiles the following snippet:
  668.  
  669. void main(void)
  670. {
  671.     char *p1,*p2;
  672.     long l;
  673.  
  674.     l = (long) p1 | (long) p2;
  675. }
  676.  
  677.  
  678. Workaround:
  679.  
  680. Casting the pointer values to a temporary before the logical-OR will result in correct code
  681. generation, i.e.:
  682. void main(void)
  683. {
  684.     char *p1,*p2;
  685.     long t1,t2,l;
  686.     t1 = (long) p1; t2 = (long) p2;
  687.     l = t1 | t2;
  688. }
  689. ----------------------------------------------------------------------------
  690.     Product: THINK C/C++
  691. ----------------------------------------------------------------------------
  692. ••Defect Number: 5934, THINK C/C++
  693.   Problem Area: SymC++ Compiler      Type: Crash
  694. Compiling the following code sample crashes with a divide by zero error. 
  695.  
  696. #include <stdlib.h>
  697. #include <fstream.h>
  698. class UI
  699. {
  700.    protected:
  701.      ofstream&    resultfile;
  702.    public:
  703.      UI( char* s );
  704.      ~UI( void );       
  705. };
  706. UI::UI( char* s)
  707. : resultfile(ofstream( s, ios::out ))
  708. {}
  709. UI::~UI( void ) { resultfile.close();}    
  710. UI userIF( "results");
  711. void main ()
  712. {
  713. }
  714. ----------------------------------------------------------------------------
  715. ••Defect Number: 6197, THINK C/C++
  716.   Problem Area: SymC++ Compiler      Type: Crash
  717. Calling a function pointer to a virtual member function of a handle based class results in a
  718. crash at the point of the function call. This is demonstrated with the following code:
  719.  
  720. class __machdl foo  {
  721. public:
  722.    virtual void bar(int a,int b) { baz = a+b; }
  723. private:
  724.    short baz;
  725. };
  726.  
  727. typedef void (foo::*PMFI)(int,int);
  728.  
  729. int main()
  730. {
  731.    PMFI pf = &foo::bar;
  732.    foo* p;
  733.  
  734.    p = new foo;
  735.    (p->*pf)(30,12);
  736.    return 0;
  737. }
  738. ----------------------------------------------------------------------------
  739.     Product: THINK C/C++, Symantec C/C++ for MPW
  740. ----------------------------------------------------------------------------
  741. ••Defect Number: 4973, THINK C/C++, Symantec C/C++ for MPW
  742.   Problem Area: SymC++ Compiler      Type: Crash
  743. With the optimizer on, compiling this code fragment produces Error:  internal error: file gloop.c
  744. line 2595:
  745.  
  746. extern char charBar[10], charFoo[10];
  747. void foo () 
  748. {
  749.     int  j=0, k=0; 
  750.     char c;
  751.     do 
  752.     {
  753.       c =  charBar [ j ] ;         
  754.         if ( ++k <= 10) 
  755.             charFoo [ k ] = 3; 
  756.     } 
  757.      while ( j++ < 0 );     
  758.  
  759. Workaround:
  760.  
  761. use a "for" loop instead of a "do-while"  or turn off optimizer
  762. ----------------------------------------------------------------------------
  763.     Product: THINK C/C++
  764. ----------------------------------------------------------------------------
  765. ••Defect Number: 3940, THINK C/C++
  766.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  767. Common sub expression elimination optimization doesn't make optimal use of temporaries.
  768.     if (condition)
  769.         a = expression;
  770.     else
  771.         d = expression
  772.         
  773.     becomes:
  774.     T = expression;
  775.     if (condition)
  776.         a = T;
  777.     else
  778.         d = expression
  779. ----------------------------------------------------------------------------
  780. ••Defect Number: 4683, THINK C/C++
  781.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  782. // The following declaration is erroneous but is improperly diagnosed.
  783. // The compiler must ensure that at least one argument to a static operator
  784. // member must be a class or reference to a class (or enum). The compiler
  785. // reports "should be 1 parameter(s) for operator". How about "at least one
  786. // argument must be a class or class&"
  787.  
  788. struct X {
  789.     static int operator>>(int);     // error here
  790.     int operator<<(int);            // OK
  791.     static int operator++(int, int);    // error here (correct)
  792. };
  793. ----------------------------------------------------------------------------
  794. ••Defect Number: 4855, THINK C/C++
  795.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  796. Compiling the code shown below causes the compiler to report an invalid error involving type
  797. conversions with pointer to member variables and complex type hierarchies.
  798.  
  799. void foo()
  800. {
  801. // 48p14h: ptr to member converted to ptr to member of derived class
  802.     // if inverse conversion of derived class ptr to base class ptr is
  803.     // accessible and conversion is unambiguous.
  804.  
  805.         class B { public: int bi; };
  806.         class C : virtual public B { int ci; };
  807.         class Y : virtual public B { int ci; };
  808.         class D : public C, public Y { public: int di; };
  809.         D d;
  810.         B *bp = &d;
  811.         int B::*bpm = &B::bi;// should be legal
  812.         int D::*dpm = bpm;//should be legal and reports an error
  813.  
  814. }//foo
  815.  
  816. Error reported is:
  817. File “MAC_LANG:DEFECTS:Attachments:4855.CP”; Line 16
  818. Error:   illegal cast
  819. from: int B::*
  820. to  : int D::*
  821.  
  822. ----------------------------------------------------------------------------
  823. ••Defect Number: 4885, THINK C/C++
  824.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  825. The ARM p.296 states that the assignment operator for a virtual base class should be called only
  826. once. In cases where the operator = is muptiply inherited to the same virtual base class, the
  827. compiler erroneously calls it twice.
  828.  
  829.                     Top
  830.               Left<--|-->Right
  831.                 |->Bottom<-|
  832.  
  833. If Left and Right declare Top as virtual and the operator = is called for Bottom, then the
  834. operator = for Top will be called twice erroneously.
  835. ----------------------------------------------------------------------------
  836.     Product: THINK C/C++, Symantec C/C++ for MPW
  837. ----------------------------------------------------------------------------
  838. ••Defect Number: 4892, THINK C/C++, Symantec C/C++ for MPW
  839.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  840. Certain template functions that might be expected to be inlined are not generated as inline.
  841.  
  842. Workaround:
  843.  
  844. If the template functions are declared in the class template declaration, then they will be
  845. inlined when possible.
  846.  
  847.     template<class T> class X {
  848.       inline X();    // body elsewhere, won't be inlined
  849.     };
  850.     template<class T> class Y {
  851.       inline X() { }    // body present, will be inlined, if possible
  852.     };
  853. ----------------------------------------------------------------------------
  854.     Product: THINK C/C++
  855. ----------------------------------------------------------------------------
  856. ••Defect Number: 4896, THINK C/C++
  857.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  858. Default function arguments involving explicit calls to constructors are erroneously disallowed.
  859.  
  860.     struct X {
  861.         X(int);
  862.     };
  863.     void f(X x = X(1));      // error: can't handle constructor in this context
  864.  
  865. Workaround:
  866.  
  867. Specify the default parameter at each function invocation for default arguments involving
  868. explicit calls to constructors.  Or use the implicit constructor syntax:
  869.  
  870.     void f(X x = 1);
  871. ----------------------------------------------------------------------------••Defect Number:
  872. 4897, THINK C/C++
  873.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  874. Pointers to member functions do not allow type conversions involving inheritance. The code below
  875. will not correctly compile unless the A class is the first base class of the object involved with
  876. the cast.
  877.  
  878. struct A {
  879.     void f();
  880. };
  881.  
  882. struct B { };
  883.  
  884. struct C : public B, public A { };
  885.  
  886. typedef void (A::*pmfa)();
  887.  
  888. void main()
  889. {
  890.     C *c;
  891.          
  892.     pmfa ma1 = &A::f;
  893.     (c->*ma1)();     // illegal cast
  894. }
  895.  
  896. Workaround:
  897.  
  898. Declare the class first that causes the casting problem, if possible.
  899. ----------------------------------------------------------------------------
  900. ••Defect Number: 5000, THINK C/C++
  901.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  902. When using ANSI compatibility mode, comments should not be allowed to start in a header file and
  903. then finish in the main file. The compiler currently allows this.
  904.  
  905. f1.c:
  906. #include "f1.h"
  907. this closes the comment but is invalid */
  908.  
  909. f1.h:
  910. /* This is a comment
  911. but it is not allowed to span files
  912. ----------------------------------------------------------------------------
  913. ••Defect Number: 5110, THINK C/C++
  914.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  915. The code shown below should produce an ambiguous reference error. The class structure looks like
  916. this
  917.     
  918.     ZooAnimal  ZooAnimal
  919.         |         |
  920.        Bear     Racoon
  921.            \   /
  922.           Panda
  923.           
  924. Class ZooAnimal and class Bear each declare a f() member function. Yet when f() is called using
  925. an object of type Panda, no ambiguous reference error is flagged. At runtime Bear::f() is called.
  926. This would be the correct behavior if ZooAnimal were a virtual base class, but it is not. (See
  927. C++ Primer, 2nd ed., p 477 (section 9.2)). 
  928.  
  929.     struct ZooAnimal {
  930.         virtual void f();
  931.     };
  932.  
  933.     struct Bear : ZooAnimal {
  934.         void f();
  935.     };
  936.  
  937.     struct Racoon : ZooAnimal {
  938.          //void f() ;
  939.     };
  940.  
  941.     struct Panda : Bear, Racoon { };
  942.   
  943.     void main ()
  944.     {         
  945.         Panda p;
  946.         p.f();  // should produce an ambiguous reference error
  947.                 // actually calls Bear::f().
  948.     }
  949.  
  950. Workaround:
  951.  
  952. Uncommenting out the 
  953.      void f();
  954. line in class Racoon causes the correct error to be generated. Or commenting out the f() function
  955. declared in Bear also causes the correct error to be generated.
  956. ----------------------------------------------------------------------------
  957. ••Defect Number: 5199, THINK C/C++
  958.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  959. The compiler does not correctly handle typedefs for nested classes where the typedef name is the
  960. same name as the nested class. It produces an incorrect error message.
  961.  
  962. struct A {
  963.     struct B {
  964.         static int x;
  965.     };
  966. };
  967. typedef A::B B;
  968. typedef A::B TDB;
  969.  
  970. int TDB::x = 1;            // typedef of another name OK
  971. int B::x = 1;            // typedef with the same name causes erroneous error:
  972.                         // 'B' must be a class name preceding '::'
  973.  
  974. Workaround:
  975.  
  976. Insure that any typedefs of nested class names are distinct from the class name itself.
  977. ----------------------------------------------------------------------------
  978. ••Defect Number: 5223, THINK C/C++
  979.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  980. The values for the predefined symbols __nan, __nans, and _inf are incorrect and not recognized as
  981. NAN's by the SANE package.
  982.  
  983. Workaround:
  984.  
  985. The SANE versions of these are correct and can be used in place of the C++ compiler's predefined
  986. symbols.
  987. ----------------------------------------------------------------------------
  988. ••Defect Number: 5226, THINK C/C++
  989.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  990. There are some problems with pascal object classes. When declaring instances of these object
  991. types errors are not always reported as in:
  992.  
  993. class __pasobj X { } ;
  994.  
  995. void f(X);      // should produce an error and does not
  996.  
  997. X g();          // Correctly produces an error message
  998.  
  999. void h(X x)     // should produce an error and does not
  1000. {
  1001.     X x2;       // Produces an error message as expected
  1002. }
  1003.  
  1004. Workaround:
  1005.  
  1006. Double check declarations involving Pascal object class types.
  1007. ----------------------------------------------------------------------------
  1008.     Product: THINK C/C++, Symantec C/C++ for MPW
  1009. ----------------------------------------------------------------------------
  1010. ••Defect Number: 5282, THINK C/C++, Symantec C/C++ for MPW
  1011.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1012. The code shown below produces a "code segment too large" error when compiled with all
  1013. optimizations and the "Place string literals in code" option checked. The problem is caused by
  1014. the index into the string literal.
  1015.  
  1016. void f(void)
  1017. {
  1018.    int i;
  1019.    char c;
  1020.    
  1021.    for (i = 0; i < 6; ++i)
  1022.      c = "abcdef"[i];
  1023. }
  1024.  
  1025. Workaround:
  1026.  
  1027. Assign a pointer to the string literal and index using the pointer, compile without
  1028. optimizations, or don't use "Place string literals in code".
  1029. ----------------------------------------------------------------------------
  1030.     Product: THINK C/C++
  1031. ----------------------------------------------------------------------------
  1032. ••Defect Number: 5402, THINK C/C++
  1033.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1034. Legitimate errors with templates sometimes list the prefix and a line number instead of the
  1035. appropriate place in the template definition.
  1036.  
  1037. Workaround:
  1038.  
  1039. When templates are involved and errors are reported in the prefix, the line number given is
  1040. usually for the file containing the template definitions.
  1041. ----------------------------------------------------------------------------
  1042. ••Defect Number: 5427, THINK C/C++
  1043.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1044. The attached file demonstrates that when a prototype for a function uses ...,  the compiler
  1045. erroneously promotes a constant to a 10 byte double when using 8 byte doubles.  
  1046.  
  1047. void f(int a, ...)
  1048. {
  1049. }
  1050.  
  1051. void main(void)
  1052. {
  1053.     f(1, 1.0);
  1054. }
  1055.  
  1056. Workaround:
  1057.  
  1058. Before passing a double constant to a function taking ... as a prototype, assign it to a
  1059. variable.  Variables are not erroneously promoted in size.
  1060. ----------------------------------------------------------------------------
  1061. ••Defect Number: 5437, THINK C/C++
  1062.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1063. The declaration of f below should be flagged as an illegal declaration.  It should not be
  1064. possible to declare a pointer to a reference. 
  1065.  
  1066. void f( int &*p );
  1067. ----------------------------------------------------------------------------
  1068. ••Defect Number: 5471, THINK C/C++
  1069.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1070. Assignments to anonymous union members produce an incorrect error message when ANSI conformance
  1071. is on.  As in the following code fragment:
  1072.  
  1073. void
  1074. test( unsigned long v )
  1075. {
  1076.     union { unsigned long lv; unsigned char cv[4]; };
  1077.  
  1078.      lv = v;    // Error produced here incorrectly
  1079.  
  1080. }
  1081.  
  1082. Workaround:
  1083.  
  1084. Turn ANSI conformance off for these cases.
  1085. ----------------------------------------------------------------------------
  1086. ••Defect Number: 5493, THINK C/C++
  1087.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1088. Destructors defined for classes based on pascal object are not being generated correctly and end
  1089. up producing references to undefined virtual dispatch tables.  As in the code shown below:
  1090.  
  1091. struct __pasobj X {
  1092.     virtual void f();
  1093.     ~X();
  1094. };
  1095.  
  1096. X::~X() { }
  1097.  
  1098. void X::f() { }
  1099.  
  1100. An undefined symbol for X::__vtbl is erroneously produced.
  1101.  
  1102. Workaround:
  1103.  
  1104. Do not use destructors for pascal object classes.
  1105. ----------------------------------------------------------------------------
  1106. ••Defect Number: 5500, THINK C/C++
  1107.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1108. When using pascal object, the compiler does not always parse the scope resolution operator
  1109. correctly if the class name begins in a leading _.  As in:
  1110.  
  1111. struct __pasobj _X {
  1112.     virtual void f();
  1113. };
  1114.  
  1115. struct X : _X {
  1116.     virtual void f();
  1117. };
  1118.  
  1119. void X::f() { 
  1120.     _X::f();    // Error:   ';' expected
  1121.  
  1122. Workaround:
  1123.  
  1124. Do not use a leading _ when declaring pascal object classes that will be subclassed.
  1125. ----------------------------------------------------------------------------
  1126. ••Defect Number: 5505, THINK C/C++
  1127.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1128. The compiler produces an error when the address of a register variable is taken. The C++ draft
  1129. explicitly allows this to be done. ARM, section 7.1.1 p. 97.
  1130.  
  1131. Workaround:
  1132.  
  1133. Remove the "register" declaration. The compiler will automatically assign variables to registers
  1134. when possible.
  1135. ----------------------------------------------------------------------------
  1136. ••Defect Number: 5506, THINK C/C++
  1137.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1138. The compiler will report an error when trying to make a non-template class have a friend template
  1139. class.
  1140.  
  1141.     template <class T> class Bar;
  1142.     class Foo {
  1143.         template<class T> friend class Bar;   // error:  ';' expected
  1144.     };
  1145.  
  1146. Workaround:
  1147.  
  1148. Declare the friend with a specific type:
  1149.     template <class T> class Bar;
  1150.     class Foo {
  1151.         friend class Bar<int>;
  1152.     };
  1153. ----------------------------------------------------------------------------
  1154. ••Defect Number: 5507, THINK C/C++
  1155.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1156. Class names are not declared until after the base class list has been parsed. This violates the
  1157. C++ rule that each name is declared immediately after it is seen (ARM p.168). This causes
  1158. problems with template expansions called for on the class declaration line as in:
  1159.  
  1160.      template<class T> class B { };
  1161.      class C : public B<C> { };  // error: template-argument 'T' must be a type-argument
  1162.  
  1163. Workaround:
  1164.  
  1165. Forward declare class C prior to its declaration.
  1166. ----------------------------------------------------------------------------
  1167. ••Defect Number: 5512, THINK C/C++
  1168.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1169. In strict ANSI mode, the compiler still recognizes the "inherited" keyword, so that errors are
  1170. produced when inherited is used as a variable name.
  1171.  
  1172.     void f(int *inherited );    // error:  ')' expected
  1173.  
  1174. Workaround:
  1175.  
  1176. Change the name of the variable to not use this keyword.
  1177. ----------------------------------------------------------------------------
  1178.     Product: THINK C/C++, Symantec C/C++ for MPW
  1179. ----------------------------------------------------------------------------
  1180. ••Defect Number: 5514, THINK C/C++, Symantec C/C++ for MPW
  1181.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1182. The compiler does not generate the 68020 MULU.L instruction for long multiplies when the 68020
  1183. option is turned on.
  1184.  
  1185.     long f(long a, long b)
  1186.     {
  1187.         return a*b;
  1188.     }
  1189.  
  1190. f(long,long):
  1191. 00000000: 4E56 0000          LINK      A6,#$0000
  1192. 00000004: 202E 000C          MOVE.L    $000C(A6),D0
  1193. 00000008: 222E 0008          MOVE.L    $0008(A6),D1
  1194. 0000000C: 4EBA 0000          JSR       ULMULT          ; instead of MULU.L
  1195. 00000010: 4E5E               UNLK      A6
  1196. 00000012: 4E74 0008          RTD       #$0008
  1197. ----------------------------------------------------------------------------
  1198.     Product: THINK C/C++
  1199. ----------------------------------------------------------------------------
  1200. ••Defect Number: 5521, THINK C/C++
  1201.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1202. Floating point constants are of type long double. This causes problems with overload resolution
  1203. and produces an error in the following case:
  1204.  
  1205.     void f(short);
  1206.     void f(double);
  1207.  
  1208.     void main()
  1209.     {
  1210.         f(1.0);             // error: ambiguous reference to function
  1211.         f(double(1.0)); // OK
  1212.     }
  1213.  
  1214.  
  1215. Workaround:
  1216.  
  1217. Declare the parameter's type as long double, or cast the constant to type double when calling the
  1218. function.
  1219. ----------------------------------------------------------------------------
  1220. ••Defect Number: 5533, THINK C/C++
  1221.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1222. Casting a pointer to function to a particular type does not handle overloading as expected, even
  1223. when the cast type exactly matches the expected type.  As in:
  1224. #include <iostream.h>
  1225.  
  1226. char * f1( int i )
  1227. {
  1228.     return("char *f1(int i)" );
  1229. }
  1230. char * f1( short s)
  1231. {
  1232.     return("char *f1(short s)" );
  1233. }
  1234. typedef char *(*PFN_INT)(int);
  1235. typedef char *(*PFN_SHORT)(short);
  1236.  
  1237. void main(void)
  1238. {
  1239.     PFN_INT pfn_int= f1;
  1240.     PFN_SHORT pfn_short = f1;
  1241.     PFN_SHORT pfn_cast_int_to_short = (PFN_SHORT) ((PFN_INT) f1);
  1242.     PFN_INT pfn_cast_short_to_int = (PFN_INT) ((PFN_SHORT) f1 );
  1243.     
  1244.     cout << pfn_int(1) << endl;                                    // This is correct
  1245.     cout << pfn_short(2) << endl;                                // OK
  1246.     cout << pfn_cast_int_to_short(3) << endl;             // May or may not be what is
  1247. expected
  1248.     cout << pfn_cast_short_to_int(4) << endl;             // May or may not be what is
  1249. expected
  1250. }
  1251.  
  1252. Workaround:
  1253.  
  1254. Instead of a cast, declare a variable of the cast type and assign the function to it.   In the
  1255. above example this would mean initializing the cast pointers to functions with the values from
  1256. the uncast versions which always will work correctly.
  1257. ----------------------------------------------------------------------------
  1258. ••Defect Number: 5539, THINK C/C++
  1259.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1260. When declaring variables of template class with functions that are declared in the body of the
  1261. template, a name conflict can occur if the name of the template variable is the same name as a
  1262. name used within the body of any inline template function.
  1263.  
  1264.     template<class T> class X {
  1265.         int x;
  1266.         void f() { x++; }   // error: undefined use of struct or union
  1267.                                 //  (X::x is hidden by main's x)
  1268.     };
  1269.  
  1270.     void main()
  1271.     {
  1272.         X<int> x;
  1273.         X<char> y;
  1274.     }
  1275.  
  1276. Workaround:
  1277.  
  1278. Do not instantiate a template instance with the same name as any local variables used in inline
  1279. functions on the template. In the above example note that x is used in the body of the member
  1280. function f().  This will cause a spurious error. If the variable name is changed to another name
  1281. not used in the inline function definition of the template, it will work as expected.
  1282. ----------------------------------------------------------------------------
  1283. ••Defect Number: 5540, THINK C/C++
  1284.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1285. You cannot declare a variable inside a struct or class body with the same name as the struct tag.
  1286.  
  1287.     struct foo {
  1288.         int foo;    // error: illegal constructor or destructor declaration
  1289.     };
  1290.  
  1291. Workaround:
  1292.  
  1293. Change the name of the member or the struct tag so that there is no conflict.
  1294. ----------------------------------------------------------------------------
  1295. ••Defect Number: 5542, THINK C/C++
  1296.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1297. Typedefs for class names declared within the body of classes cannot then be used in member
  1298. functions with the scope resolution operator.  As in:
  1299.  
  1300. class cFooParent {
  1301. public:
  1302.     void xxx(void);
  1303. };
  1304.  
  1305. class cFoo : public cFooParent
  1306. {
  1307.     typedef cFooParent super;
  1308. public:
  1309.     void xxx(void); 
  1310. };
  1311.  
  1312. void cFoo:: xxx()
  1313. {
  1314.     super::xxx();          // Error is produced here
  1315.     cFooParent::xxx(); /* OK */
  1316. }
  1317.  
  1318. Error is:
  1319. File “5542.cpp”; Line 16
  1320. Error:   no instance of class 'cFooParent' for member 'cFooParent::xxx'
  1321.  
  1322.  
  1323.  
  1324. Workaround:
  1325.  
  1326. Declare the typedef outside of the body of the subclass or use the name of the desired parent
  1327. class directly.
  1328. ----------------------------------------------------------------------------
  1329. ••Defect Number: 5547, THINK C/C++
  1330.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1331. When there are multiple parameters to an overloaded function and there is not an exact match for
  1332. the overloaded function, the compiler does not use a best fit approach to determine the correct
  1333. function to call.   It will instead report an ambiguity.  As in:
  1334.  
  1335. class A {
  1336. public:
  1337.    A (short, char*, int&); 
  1338.    A (long, char*, int&);  
  1339. };
  1340. void
  1341. Test (void)
  1342. {
  1343.    int i;
  1344.  
  1345.    short shortVal;
  1346.    long longVal;
  1347.  
  1348.    A test1(shortVal,0, i);            // Ambiguity reported here
  1349.    A test2(longVal,  0, i);            // Ambiguity reported here
  1350. }
  1351.  
  1352. Errors are:
  1353. File “5547.cpp”; Line 14
  1354. Error:   ambiguous reference to function
  1355. Had: A::A(short ,char *,int ref)
  1356. and: A::A(long ,char *,int ref)
  1357.  
  1358. File “5547.cpp”; Line 15
  1359. Error:   ambiguous reference to function
  1360. Had: A::A(short ,char *,int ref)
  1361. and: A::A(long ,char *,int ref)
  1362.  
  1363.  
  1364. Workaround:
  1365.  
  1366. Use casts to get all of the parameters to match an existing function.  In the above example
  1367. casting the 0 to a (char *) causes the compiler to exactly match the short and long versions of
  1368. the constructor without a problem. 
  1369. ----------------------------------------------------------------------------
  1370. ••Defect Number: 5557, THINK C/C++
  1371.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1372. The compiler does not complain about _machdl class members inside a C++ class as it should.  As
  1373. in:
  1374.  
  1375. class __machdl foo { public: double go (void); };
  1376. class bar : public foo { };
  1377.  
  1378. class baz
  1379. {
  1380.         public :
  1381.                 foo quux1;      // Should produce an error
  1382.                 foo *quux2;     // OK 
  1383. }
  1384.  
  1385. Workaround:
  1386.  
  1387. Avoid declaring these constructs as the behavior will not be correct at run-time.
  1388. ----------------------------------------------------------------------------
  1389. ••Defect Number: 5620, THINK C/C++
  1390.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1391. The compiler does not allow derived classes to be directly created from nested base classes.  As
  1392. in:
  1393.  
  1394. class S
  1395. {
  1396. public:
  1397.     class T
  1398.     {
  1399.         int a;
  1400.     };
  1401.     int b;
  1402. };
  1403.  
  1404. class V : S::T {
  1405.     int c;
  1406. };
  1407.  
  1408. Error:
  1409. File “5620.cpp”; Line 11
  1410. Error:   '{' expected
  1411.  
  1412. File “5620.cpp”; Line 13
  1413. Error:   identifier or '( declarator )' expected
  1414.  
  1415.  
  1416. Workaround:
  1417.  
  1418. Create a typedef for the nested base class first and then use the typedef to declare the derived
  1419. class, as in:
  1420. typedef S::T Z;
  1421. class W : public Z
  1422. {
  1423.     int c;
  1424. };
  1425.  
  1426. which works as expected.
  1427. ----------------------------------------------------------------------------
  1428. ••Defect Number: 5628, THINK C/C++
  1429.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1430. Static member functions that should be accessible to derived classes are not accessible.  As in:
  1431. class moe
  1432. {
  1433. public:
  1434.     static void f1();
  1435. protected:
  1436.     static void f2();
  1437.     void f3();
  1438. };
  1439.  
  1440. class curly : public moe
  1441. {
  1442. private:
  1443.     static void g()
  1444.     {
  1445.         f1();           // OK
  1446.         f2();           // OK
  1447.         moe::f1();      // OK
  1448.         moe::f2();      // Error produced here
  1449.     };
  1450.     
  1451.     void h()
  1452.     {
  1453.         f3();           // OK
  1454.         moe::f3();      // OK
  1455.     };
  1456. };
  1457.  
  1458. Error is:
  1459. File “5628.cp”; Line 18
  1460. Error:   member 'moe::f2' of class 'moe' is not accessible
  1461.  
  1462.  
  1463. Workaround:
  1464.  
  1465. Declare static member functions as public, or declare the functions that need to call them as
  1466. friend functions.
  1467. ----------------------------------------------------------------------------
  1468.     Product: THINK C/C++, Symantec C/C++ for MPW
  1469. ----------------------------------------------------------------------------
  1470. ••Defect Number: 5629, THINK C/C++, Symantec C/C++ for MPW
  1471.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1472. When ANSI conformance is turned on, a call to new that takes a typedef for an array type gives an
  1473. error about an empty declaration.  As in:
  1474.  
  1475. typedef char C_NAME[33];
  1476. void joe()
  1477. {
  1478. char*   name1 = new char[33];
  1479. char*   name2 = new C_NAME;         // Error is here
  1480. }
  1481.  
  1482. Error is:
  1483. File “5629.cpp”; Line 5
  1484. Error:   empty declaration
  1485.  
  1486.  
  1487. Workaround:
  1488.  
  1489. Turn ANSI flag off, or add empty parens after typedef name ().
  1490. ----------------------------------------------------------------------------
  1491.     Product: THINK C/C++
  1492. ----------------------------------------------------------------------------
  1493. ••Defect Number: 5631, THINK C/C++
  1494.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1495. Constructors that are declared as static member functions are not flagged as an error by the
  1496. compiler.  This is incorrect according to the ARM Sec 12.1 p.262.  As in:
  1497.  
  1498. class X {
  1499.     static X();   // static constructor not flagged
  1500. };
  1501.  
  1502. X::X()
  1503. {
  1504. }
  1505.  
  1506.  
  1507.  
  1508. Workaround:
  1509.  
  1510. Exercise care to insure that constructors are not declared static
  1511. ----------------------------------------------------------------------------
  1512. ••Defect Number: 5632, THINK C/C++
  1513.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1514. In a scope where a class with a constructor is declared, other functions which have the same name
  1515. as the class produce invalid error messages as in:
  1516.  
  1517. class X {
  1518.     X();
  1519. };
  1520.  
  1521. int X()
  1522. {               // Error is produced here
  1523.     return 0;
  1524. }
  1525.  
  1526. Error is:
  1527. File “5632.cpp”; Line 6
  1528. Error:   no constructor allowed for class 'X'
  1529.  
  1530.  
  1531. Workaround:
  1532.  
  1533. Do not declare functions with the same name as the class unless they are the constructor for the
  1534. class.
  1535. ----------------------------------------------------------------------------
  1536. ••Defect Number: 5635, THINK C/C++
  1537.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1538. Calls to PascalObject constructors and destructors are not propagated up the inheritance chain.
  1539. Base class constructors or destructors, if they exist, will never get called.
  1540.  
  1541. Workaround:
  1542.  
  1543. Either explicitly call base class constructors, or use a parallel construction scheme, like the
  1544. TCL's Cxxx::ICxxx().
  1545. ----------------------------------------------------------------------------
  1546. ••Defect Number: 5636, THINK C/C++
  1547.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1548. In some cases, the compiler will let you access members of a PascalObject class that are not
  1549. accessible. For example:
  1550.  
  1551.     class X : PascalObject {
  1552.     private:
  1553.         void f();
  1554.     };
  1555.     void main()
  1556.     {
  1557.          X *x = new X;
  1558.          x->f();               // should be flagged as an error, but isn't
  1559.          delete x;
  1560.     }
  1561. ----------------------------------------------------------------------------
  1562. ••Defect Number: 5638, THINK C/C++
  1563.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1564. The compiler doesn't recognize class friends when determining access for constructors or
  1565. destructors of class members. If a class member has a constructor or destructor that would be
  1566. inaccessible without the friend declaration, then the compiler will not allow the class
  1567. declaration. The error isn't flagged for member functions of the declared class that try to
  1568. access the private constructors or destructors.
  1569.  
  1570.     struct Y;
  1571.     struct X {
  1572.         friend Y;
  1573.     private:
  1574.         X();
  1575.     };
  1576.     struct Y {
  1577.         void f() { X x; }     // OK
  1578.         X x;                      // Error:   member 'X::X' of class 'X' is not accessible
  1579.     }; 
  1580.  
  1581. Workaround:
  1582.  
  1583. For now, make the constructors and/or destructors public.
  1584. ----------------------------------------------------------------------------
  1585. ••Defect Number: 5640, THINK C/C++
  1586.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1587. Nested typedef names that appear inside templates are not recognized correctly by the compiler.
  1588. For example:
  1589.  
  1590.     template <class T> struct X {
  1591.         typedef T* TP;
  1592.     };
  1593.      
  1594.     void main()
  1595.     {
  1596.         X<int>::TP p = 0;                 // Error:   'X<int>::TP' is not a variable
  1597.         typedef X<int>::TP MyTP;    // create typedef for nested type
  1598.         MyTP p2 = 0;                      // Works OK
  1599.     }
  1600.  
  1601. Workaround:
  1602.  
  1603. Introduce another (local) typedef for the nested typedef.
  1604. ----------------------------------------------------------------------------
  1605. ••Defect Number: 5647, THINK C/C++
  1606.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1607. There is a bug in the C++ compiler that causes certain macro expansions to produce incorrect
  1608. results. The compiler fails to re-scan the arguments to the token pasting preprocessor directive
  1609. in some cases. Eg:
  1610.  
  1611.     #define X(s) Y(s)
  1612.     #define Y(s) foo##s
  1613.     #define T bar
  1614.  
  1615.     int X(T);    // produces a variable called "fooT", not "foobar"
  1616. ----------------------------------------------------------------------------
  1617. ••Defect Number: 5649, THINK C/C++
  1618.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1619. Template-based overloaded operator functions may not be automatically expanded by the compiler in
  1620. some cases. For example:
  1621.  
  1622.     template <class T> struct X { };
  1623.      
  1624.     template <class T> X<T>& operator+ (X<T>&, X<T>&)
  1625.     {
  1626.         return *new X<T>;
  1627.     }
  1628.     
  1629.     //X<int>& operator+ (X<int>&, X<int>&);       // add this line to work around the bug
  1630.      
  1631.     void main()
  1632.     {
  1633.         X<int> i, j, k;
  1634.         i = j + k;          // Error:   illegal operand types
  1635.     }
  1636.  
  1637. Workaround:
  1638.  
  1639. The compiler must be forced to expand the template function by providing a prototype for the
  1640. function with the correct argument types provided.
  1641. ----------------------------------------------------------------------------
  1642. ••Defect Number: 5656, THINK C/C++
  1643.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1644. In some cases, the compiler will allow the modification of a const class object. For example:
  1645.  
  1646.     struct X {
  1647.         int y;
  1648.     };
  1649.     
  1650.     void main()
  1651.     {
  1652.         X x1;
  1653.         const X x2;
  1654.     
  1655.         x2 = x1;          // should report an error, but doesn't
  1656.     }
  1657. ----------------------------------------------------------------------------
  1658. ••Defect Number: 5657, THINK C/C++
  1659.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1660. The compiler fails to signal an error when it sees a void function that has a return statement
  1661. with an expression, if that expression's type is void (eg, when the expression is a function
  1662. whose return type is void).
  1663. ----------------------------------------------------------------------------
  1664. ••Defect Number: 5671, THINK C/C++
  1665.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1666. Due to the way that the compiler chooses "key" functions for a class, inline functions that are
  1667. not declared as inline in a class declaration can cause problems when creating a precompiled
  1668. header. Eg:
  1669.  
  1670.     struct X {
  1671.         void f();
  1672.         virtual void g();
  1673.     };
  1674.     
  1675.     inline void X::f() { }  // Error: vtable key function 'f' cannot be redeclared inline in
  1676. precompiled header
  1677.  
  1678. Workaround:
  1679.  
  1680. Declare the function as "inline" in the class declaration as well as the function declaration.
  1681. ----------------------------------------------------------------------------
  1682. ••Defect Number: 5701, THINK C/C++
  1683.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1684. C++ classes with virtual functions cannot be used in code resources. If you try define a C++
  1685. class with a virtual function in a code resource, you will get the error: "initialization to an
  1686. address is illegal for a non-application".
  1687.  
  1688. Workaround:
  1689.  
  1690. Use PascalObject classes in code resources instead of regular C++ classes. PascalObject classes
  1691. can contain virtual functions in code resources.
  1692. ----------------------------------------------------------------------------
  1693. ••Defect Number: 5738, THINK C/C++
  1694.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1695. The compiler doesn't allow forward declarations of specific template expansions. If a template is
  1696. forward declared, and then is used with a specific expansion, any use of the template later on
  1697. will not work. For example:
  1698.  
  1699.     template <class T> struct X;
  1700.     
  1701.     void dummy(X<char>);        // this declaration "confuses" the compiler    
  1702.     template <class T> struct X {
  1703.         void f();
  1704.     };
  1705.     
  1706.     void main()
  1707.     {
  1708.         X<char> *x;
  1709.         x->f();                       // Error: 'f' not a member of struct 'X<char>'
  1710.     }
  1711. ----------------------------------------------------------------------------
  1712. ••Defect Number: 5743, THINK C/C++
  1713.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1714. The compiler fails to call conversion operator functions whose conversion type is an enumeration.
  1715. For example:
  1716.  
  1717.     enum E { whatever };
  1718.     
  1719.     struct X {
  1720.         operator E();
  1721.     };
  1722.     
  1723.     void main()
  1724.     { 
  1725.         X x;
  1726.         E e;
  1727.     
  1728.         if (e == x) ;     // Error: ambiguous type conversion
  1729.         if (e == (E)x) ;  // works OK
  1730.    }
  1731.  
  1732. Workaround:
  1733.  
  1734. Provide an explicit cast to force the compiler to use the correct conversion operator.
  1735. ----------------------------------------------------------------------------
  1736. ••Defect Number: 5759, THINK C/C++
  1737.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1738. If an #endif is encountered without any matching #if, and if no other #if statements have yet
  1739. been seen by the compiler, then the compiler will write to 0 (NIL) before reporting the error. No
  1740. other corruption of low memory will occur.
  1741. ----------------------------------------------------------------------------
  1742. ••Defect Number: 5760, THINK C/C++
  1743.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1744. The result of applying the modulo operator to an unsigned short or unsigned char will appear to
  1745. produce an incorrect result when its result is examined in a conditional expression. For example:
  1746.  
  1747.     #include <stdio.h>
  1748.     
  1749.     void main()
  1750.     {
  1751.         unsigned short n = 2;
  1752.     
  1753.         if (n % 2)
  1754.             printf("wrong\n");
  1755.         else
  1756.             printf("right\n");
  1757.     }
  1758.  
  1759. The result of the modulo operator is correct in all other contexts, eg in an arithmetic
  1760. expression.
  1761.  
  1762. Workaround:
  1763.  
  1764. Compare the result of the modulo to zero, eg:
  1765.  
  1766. if ((n % 2) != 0)
  1767. ----------------------------------------------------------------------------
  1768. ••Defect Number: 5761, THINK C/C++
  1769.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1770. The compiler is unable to choose the correct conversion operator when possible conversions differ
  1771. only by the const-ness of the class that's being converted. For example:
  1772.  
  1773.     struct X { };
  1774.     
  1775.     struct Y {
  1776.         operator X();
  1777.         operator X() const;
  1778.     };
  1779.     
  1780.     void f()
  1781.     {
  1782.         const Y y;
  1783.         X x = y;      // Error: cannot implicitly convert
  1784.     }
  1785.  
  1786. Workaround:
  1787.  
  1788. Using an explicit call to the conversion operator will work, eg:
  1789.  
  1790. X x = y.operator X();      // OK; chooses operator X() const
  1791. ----------------------------------------------------------------------------
  1792. ••Defect Number: 5763, THINK C/C++
  1793.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1794. A nested scope enum will clash with a global scope enum instead of hiding it. For example:
  1795.  
  1796.     enum foo { one, two, three };
  1797.     class X {
  1798.         enum foo {true, false };        // Error: foo is already defined
  1799.     };
  1800.  
  1801. Workaround:
  1802.  
  1803. Move the global scope enum after the class declaration with the nested enum.
  1804. ----------------------------------------------------------------------------
  1805. ••Defect Number: 5783, THINK C/C++
  1806.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1807. The compiler cannot select the correct function pointer when an overloaded function name is used
  1808. as an argument to a constructor. For example:
  1809.  
  1810.     struct X {
  1811.         X(void (*)(int));
  1812.     };
  1813.     void g(char);
  1814.     void g(int);
  1815.     
  1816.     X x = X(g);
  1817.  
  1818. Other uses of overloaded function names, such as in non-constructor function calls and assignment
  1819. work correctly.
  1820.  
  1821. Workaround:
  1822.  
  1823. If possible, rearrange the declarations for the overloaded function name so that the desired
  1824. function occurs first. This will let the compiler find the correct function.
  1825. ----------------------------------------------------------------------------
  1826. ••Defect Number:
  1827. 5847, THINK C/C++
  1828.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1829. The debugger will not be able to single-step through an expanded template function if it itself
  1830. forced an expansion of another template function. In the debugger, no breakpoint diamond will
  1831. appear within the template function body. For example:
  1832.  
  1833.     template <class T> void g(T) { }
  1834.     template <class T> void f(T t)
  1835.     {
  1836.         g(t);
  1837.     }
  1838.     void main()
  1839.     {
  1840.         f(0);
  1841.     }
  1842.  
  1843. Workaround:
  1844.  
  1845. Force the expansion of the second template before it is automatically expanded by providing a
  1846. prototype. Eg, put the prototype
  1847.  
  1848. void g(int);
  1849.  
  1850. before the declaration of the template function f() above.
  1851. ----------------------------------------------------------------------------
  1852. ••Defect Number: 5855, THINK C/C++
  1853.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1854. Attempting to delete an object that is allocated in a volatile pointer results in an incorrect
  1855. error. 
  1856. struct foo { };
  1857. void f()
  1858. {
  1859.     volatile foo *foop;
  1860.     foop = new foo;
  1861.     delete foop;            // no destructor found matching delete (volatile foo*)
  1862. }
  1863. ----------------------------------------------------------------------------
  1864. ••Defect Number: 5883, THINK C/C++
  1865.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1866. If you have a C++ source file with two different function scope static variables that have the
  1867. same name, the debugger will only be able to display the value of the first static variable.
  1868. ----------------------------------------------------------------------------
  1869. ••Defect Number: 5895, THINK C/C++
  1870.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1871. The C++ compiler does not support aggregates whose size is greater than 32K. If you try to use an
  1872. aggregate larger than 32K, the compiler will generate incorrect code to reference fields beyond
  1873. the 32K boundary.
  1874. ----------------------------------------------------------------------------
  1875. ••Defect Number: 5909, THINK C/C++
  1876.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1877. The compiler promotes expressions of type "double" to type "long double" in certain cases, which
  1878. can result in unexpected "ambiguous function" errors.
  1879.  
  1880.     struct X {
  1881.         X(double);
  1882.         X(int);
  1883.     };
  1884.     double d();
  1885.     void main()
  1886.     {
  1887.         X x(d());        // Error: ambiguous reference to function X::X()
  1888.     }
  1889.  
  1890. Workaround:
  1891.  
  1892. Either explicitly cast the expression to double, or declare the function to take a parameter of
  1893. type long double.
  1894. ----------------------------------------------------------------------------
  1895. ••Defect Number: 5918, THINK C/C++
  1896.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1897. Due to the way that Symantec C++ generates function calls, the toolbox routine PlotCIconHandle()
  1898. may not always return a valid error code. This is because the compiler reserves stack space
  1899. without clearing it, and the toolbox does not always set the return value to zero.
  1900.  
  1901. Workaround:
  1902.  
  1903. Instead of using the regular glue for PlotCIconHandle, use this glue instead. It clears the OSErr
  1904. result before calling the trap.
  1905.  
  1906. pascal OSErr MyPlotCIconHandle( Rect*, short, short, CIconHandle)
  1907.    = { 0x7000, 0x3F40, 0x000C, 0x303C, 0x61F, 0xABC9};
  1908. ----------------------------------------------------------------------------
  1909. ••Defect Number: 5921, THINK C/C++
  1910.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1911. In some cases, a local (function scope) variable name will hide the name of a class declared at
  1912. file scope. For example:
  1913.  
  1914.     class X { };
  1915.     void main()
  1916.     {
  1917.         int X;
  1918.         class X x;   // Error: size of type is not known
  1919.     }
  1920. ----------------------------------------------------------------------------
  1921. ••Defect Number: 5936, THINK C/C++
  1922.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1923. The compiler does not allow a linkage declaration that contains only a typedef. Eg:
  1924.  
  1925.     extern "C" typedef void (*PFV)();
  1926.  
  1927. Workaround:
  1928.  
  1929. Rewrite to use a multiline linkage declaration.
  1930. ----------------------------------------------------------------------------
  1931. ••Defect Number: 5950, THINK C/C++
  1932.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1933. Compiling the following code example produces the confusing error message "Error: member 'M::m'
  1934. of class 'Mfriend' is not  accessible":
  1935.  
  1936. class M {
  1937.  friend class Mfriend;
  1938.  static int m;
  1939. };
  1940.  
  1941. class Mfriend {
  1942.  int i[M::m];      
  1943. };
  1944.  
  1945. The error should be: "integer constant expression expected".
  1946. ----------------------------------------------------------------------------
  1947. ••Defect Number: 5951, THINK C/C++
  1948.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1949. The compiler will produce a spurious error message if it encounteres an access declaration that
  1950. specifies a conversion operator using an intrinsic (builtin) type. Eg:
  1951.  
  1952.     struct X {
  1953.         operator int();
  1954.     };
  1955.  
  1956.     class Y : X {
  1957.     public:
  1958.         X::operator int;  // Error: empty declaration
  1959.     };
  1960.  
  1961. Workaround:
  1962.  
  1963. Turn off the "ANSI conformance" switch.
  1964. ----------------------------------------------------------------------------
  1965. ••Defect Number: 5979, THINK C/C++
  1966.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1967. If a function template has arguments with const or volatile modifiers, and if it's called more
  1968. than once with arguments that are not const or volatile, an error is produced. Eg:
  1969.  
  1970.     template<class T> void f(const T&) { }
  1971.  
  1972.     void main(void)
  1973.     {
  1974.         f(1);
  1975.         f(2);   // Error: f already defined
  1976.     }
  1977.  
  1978. Workaround:
  1979.  
  1980. Before using the function template, declare the function with the arguments that will be needed.
  1981. Eg:
  1982.  
  1983. void f(const int &);
  1984. ----------------------------------------------------------------------------
  1985. ••Defect Number: 6018, THINK C/C++
  1986.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  1987. If you declare a data member of a class whose constructor takes arguments, and if you try to pass
  1988. the arguments to the constructor in the declaration, the compiler will produce an error at the
  1989. line of the member's constructor source code.
  1990.  
  1991.     struct X {
  1992.         X(int);   // Error:   ';' expected
  1993.     };
  1994.     struct Y {
  1995.         X x(0);  // incorrect declaration here
  1996.     };
  1997. ----------------------------------------------------------------------------
  1998. ••Defect Number: 6037, THINK C/C++
  1999.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2000. Overloading resolution does not work correctly over an inheritance hierarchy for reference
  2001. conversions (cf. ARM Section 13.2 [3] p. 324) as shown by the following example:
  2002.  
  2003. class A {};
  2004. class B : public A {};
  2005. class C : public B {};
  2006.  
  2007. void g(A&);
  2008. void g(B&);
  2009.  
  2010. C aC;
  2011.  
  2012. void f()
  2013. {
  2014.     g(aC);
  2015. }
  2016. ----------------------------------------------------------------------------
  2017. ••Defect Number: 6051, THINK C/C++
  2018.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2019. The C++ compiler won't accept array initialization when the elements are addresses of a local
  2020. variable. Globals work, as does the initialization of a single (non array) object:
  2021.  
  2022. int g1, g2;
  2023.  
  2024. void main(void)
  2025. {
  2026.     int n1, n2;
  2027.  
  2028.     const int   *i1 = &n1;                  // ok
  2029.     const int   *array[] = { &n1, &n2 };    // error
  2030.     const int   *array2[] = { &g1, &g2 };   // ok
  2031. }
  2032. ----------------------------------------------------------------------------
  2033. ••Defect Number: 6054, THINK C/C++
  2034.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2035. The following example will not compile: 
  2036.  
  2037. struct X {
  2038.     X();            // having a destructor yields same error
  2039.     void foo();
  2040. };
  2041.  
  2042. void main()
  2043. {
  2044.     int rows = 3;
  2045.     const int cols = 2;
  2046.     
  2047.     typedef X PTR[cols];    // error goes away if constructor for X is commented out
  2048.     PTR     *ptr = new PTR[rows];
  2049.     delete [] ptr;
  2050. }
  2051. // File "test.cpp"; Line 15
  2052. // Error:   cannot implicitly convert
  2053. // from:<*>X
  2054. // to  :<*><array[2]>X
  2055. ----------------------------------------------------------------------------
  2056.     Product: THINK C/C++, Symantec C/C++ for MPW
  2057. ----------------------------------------------------------------------------
  2058. ••Defect Number: 6070, THINK C/C++, Symantec C/C++ for MPW
  2059.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2060. Compiling the following code sample produces internal error: file n2.c line 1355.
  2061.  
  2062. template<class T> struct Tlink
  2063. {
  2064. };  
  2065. template<class T> class s;
  2066. template<class T> class s_iter {
  2067.  public:
  2068.   T* first() 
  2069.     {
  2070.       return &((Tlink<T>*) 0;
  2071.     }
  2072. };
  2073. template<class T> class s
  2074. {
  2075. friend class s_iter<T>;
  2076. };  
  2077. void main (int argc, char* argv[])
  2078. {
  2079.  s<int> test;
  2080. }
  2081. ----------------------------------------------------------------------------
  2082. ••Defect Number: 6090, THINK C/C++, Symantec C/C++ for MPW
  2083.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2084. The compiler will report an internal error in n2.c when a template class forward declaration is
  2085. syntactically incorrect. Consider the following:
  2086.  
  2087. template <class tType> class TArchiver<tType>;            
  2088.  
  2089. class CFont
  2090. {
  2091. public:
  2092.     CFont();
  2093.     friend TArchiver<CFont>;
  2094. };
  2095. ----------------------------------------------------------------------------
  2096. ••Defect Number: 6094, THINK C/C++, Symantec C/C++ for MPW
  2097.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2098. The following code fragment causes an "expression expected" on the marked line:
  2099.  
  2100. void main()
  2101.     typedef int x;
  2102.      {
  2103.       x(((x)));          // error reported here
  2104.       x = 3;
  2105.      }
  2106. }
  2107. ----------------------------------------------------------------------------
  2108.     Product: THINK C/C++
  2109. ----------------------------------------------------------------------------
  2110. ••Defect Number: 6097, THINK C/C++
  2111.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2112. The C++ preprocessor can put an incorrect amount of space in the preprocessed output which
  2113. prevents the compiler from compiling it. It does not affect what is passed to the compiler itself
  2114. (i.e. the code compiles and runs without a problem). For example, 
  2115.  
  2116. typedef short X;
  2117. #define X(y) short y
  2118.  
  2119. void main(void)
  2120. {
  2121.  X(*) a;
  2122.  X    b = 3;
  2123.  a = &b;
  2124. }
  2125.  
  2126. preprocesses to: 
  2127.  
  2128. typedef short X;
  2129. #define X(y) short y
  2130.  
  2131. void main(void)
  2132. {
  2133.  short  *  a;
  2134.  Xb = 3;      
  2135.  a = &b;
  2136. }
  2137. ----------------------------------------------------------------------------
  2138.     Product: THINK C/C++, Symantec C/C++ for MPW
  2139. ----------------------------------------------------------------------------
  2140. ••Defect Number: 6106, THINK C/C++, Symantec C/C++ for MPW
  2141.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2142. The compiler will (incorrectly) allow a class to be specified as a direct base class of a derived
  2143. class more than once:
  2144.  
  2145. struct A1 {
  2146.     A1();
  2147.     virtual ~A1();
  2148. };
  2149.  
  2150. struct B1 :  A1 {
  2151.     B1();
  2152.     virtual ~B1();
  2153. };
  2154.  
  2155. struct C1 : B1 {
  2156.     C1();
  2157.     virtual ~C1();
  2158. };
  2159.  
  2160. struct D1 : B1, virtual A1 {
  2161.     D1();
  2162.     ~D1();
  2163. };
  2164. ----------------------------------------------------------------------------
  2165.     Product: THINK C/C++
  2166. ----------------------------------------------------------------------------
  2167. ••Defect Number: 6112, THINK C/C++
  2168.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2169. Compiling a file containing simply "#endif " sometimes writes to nil.
  2170. ----------------------------------------------------------------------------
  2171.     Product: THINK C/C++, Symantec C/C++ for MPW
  2172. ----------------------------------------------------------------------------
  2173. ••Defect Number: 6127, THINK C/C++, Symantec C/C++ for MPW
  2174.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2175. Static references to const don't construct the referenced object. Temporary references to const
  2176. work correctly:
  2177.  
  2178. #include <stdio.h>
  2179. struct S{
  2180. int ii;
  2181.     S(int i):ii(i){};
  2182. };
  2183.  
  2184. const S &rS(4);  //fails
  2185.     
  2186. void main()
  2187. {
  2188. //const S &rS(4);  // works
  2189. printf("%d\n", rS.ii);
  2190. }
  2191. ----------------------------------------------------------------------------
  2192. ••Defect Number: 6128, THINK C/C++, Symantec C/C++ for MPW
  2193.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2194. The common subexpression elimination portion of the global optimizer generates an internal error
  2195. (CGcod.c line 320) on the following line extracted from a complex switch statement.
  2196.  
  2197.         if ( C >= B - 3 && C <= B && C >= D - 3  && C <= D )
  2198.                 return  P6;
  2199.  
  2200. where B, C, and D are of type char and P6 is an enumerated value.
  2201.  
  2202. Workaround:
  2203.  
  2204. Turning off CSE elimination removes the internal error.
  2205. ----------------------------------------------------------------------------
  2206. ••Defect Number: 6131, THINK C/C++, Symantec C/C++ for MPW
  2207.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2208. Unable to use global scope resolution in declarator for a pointer to member, i.e.
  2209.  
  2210. struct C
  2211. {
  2212.     int i;
  2213. };
  2214.  
  2215. void f()
  2216. {
  2217.    struct C{};    
  2218.    int ::C::*pmi;    // Error:   '=', ';' or ',' expected
  2219. }
  2220.  
  2221. ----------------------------------------------------------------------------
  2222. ••Defect Number: 6132, THINK C/C++, Symantec C/C++ for MPW
  2223.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2224. The compile does not accept a pointer to member with the scope resolution operator, i.e.
  2225.  
  2226. struct C
  2227. {
  2228.     int i;
  2229. };
  2230.  
  2231. void f()
  2232. {
  2233.    int C::*pmi=&::C::i;   // Error:   no instance of class 'C' for member 'C::i'
  2234. }
  2235.  
  2236. ----------------------------------------------------------------------------
  2237. ••Defect Number: 6133, THINK C/C++, Symantec C/C++ for MPW
  2238.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2239. The compiler shows incomplete closure of nested class scope of a static member. Consider the
  2240. following example:
  2241.  
  2242. #include <stdio.h>
  2243. int i = 7;
  2244.  
  2245. class Outer{
  2246. public:
  2247.   class C{ 
  2248.     public: int f3() { printf("%d\n",i); return i;}; //returns value of global instead of static int i
  2249.   } c;
  2250.  
  2251.   static int i;                // declared here
  2252.   Outer(int j) { i=j+3;}
  2253.   
  2254.   class C2{ 
  2255.     public: int f3(){ printf("%d\n",i); return i;};  //correctly returns value of static int
  2256.   } c2;
  2257.  
  2258. };
  2259.     
  2260. Outer::i;
  2261.  
  2262. void main()
  2263. {
  2264.     Outer o(0);
  2265.     int temp=o.c.f3();
  2266.     temp=o.c2.f3();
  2267. }
  2268.  
  2269. Workaround:
  2270.  
  2271. Declare Outer::i before the declaration/definition of class C and it will find the correct value.
  2272. ----------------------------------------------------------------------------
  2273. ••Defect Number: 6134, THINK C/C++, Symantec C/C++ for MPW
  2274.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2275. If the second and third operands of ?: are references, then reference conversions should bring
  2276. them to a common type. This is a problem with references to derived classes. Consider the
  2277. following example:
  2278.  
  2279. class omni {
  2280. public:
  2281.     int i;
  2282.     operator int() { return i; }; //necessary use references in ?:
  2283. };
  2284.  
  2285. void ieq(int, int);
  2286. ivalue(int i);
  2287.  
  2288. class D : public omni { int j; };
  2289.       
  2290. void f()
  2291. {
  2292.     int li;
  2293.       omni a, c;
  2294.       omni &ar = a, &cr = c;
  2295.               
  2296.       D b;
  2297.       D &br = b;
  2298.       
  2299.       li=( ivalue(1) ? ar : cr ).i;
  2300.       li=( ivalue(1) ? ar : br ).i;     // br reference to D, derived from omni
  2301. }
  2302. ----------------------------------------------------------------------------
  2303. ••Defect Number: 6135, THINK C/C++, Symantec C/C++ for MPW
  2304.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2305. The compiler does not allow you to initialize references to functions. The following code will
  2306. not compile successfully:
  2307.  
  2308.    void fv(void){};
  2309.    void (&rfv)(void)=fv;
  2310. ----------------------------------------------------------------------------
  2311. ••Defect Number: 6136, THINK C/C++, Symantec C/C++ for MPW
  2312.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2313. The compiler will not allow a pointer to a function to be used in a call to new.
  2314.  
  2315. void f()
  2316. {
  2317.     char *(**p1)(int) = new (char *(*)(int));
  2318. }
  2319.  
  2320. Workaround:
  2321.  
  2322. Use a typedef, i.e.
  2323. void f()
  2324. {
  2325.   typedef char *(*t)(int);
  2326.   t *p2 = new t(*p2);
  2327. }
  2328. ----------------------------------------------------------------------------
  2329.     Product: THINK C/C++
  2330. ----------------------------------------------------------------------------
  2331. ••Defect Number: 6145, THINK C/C++
  2332.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2333. The compiler allows a call to a pure virtual function that is never defined, resulting in a link
  2334. error. Consider the following:
  2335.  
  2336. struct X {
  2337.     virtual void f() = 0;
  2338. };
  2339.  
  2340. struct Y : X {
  2341.     void f() { inherited::f(); }    // illegal
  2342. };
  2343.  
  2344. X *x;
  2345.  
  2346. void main()
  2347. {
  2348.     x = new Y;    
  2349.     x->f();    
  2350.     delete x;
  2351. }
  2352. ----------------------------------------------------------------------------
  2353.     Product: THINK C/C++, Symantec C/C++ for MPW
  2354. ----------------------------------------------------------------------------
  2355. ••Defect Number: 6147, THINK C/C++, Symantec C/C++ for MPW
  2356.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2357. After a valid diagnostic regarding access, the compiler will produce an internal error.  The
  2358. following example:
  2359.  
  2360. class b
  2361.     {
  2362. public:
  2363.     b(int ii) : i(ii) { }
  2364. protected:
  2365.     int i;
  2366.     };
  2367.     class c : virtual private b
  2368.     {
  2369. protected:
  2370.     b::i;     
  2371. public:
  2372.     c(int ii) : b(ii) { }
  2373.     };
  2374.     
  2375. class c2 : virtual private b
  2376.     {
  2377. public:
  2378.     c2(int ii) : b(ii) { }
  2379.     };
  2380.     
  2381. class d : public c, public c2
  2382.     {
  2383. public:
  2384.  
  2385.     d(int ii) :
  2386.         b(ii)  // internal error here
  2387.         { }
  2388.     };
  2389.  
  2390. Produces:
  2391. File “6147.cpp”; Line 29
  2392. Error:   member 'b::b' of class 'd' is not accessible
  2393.  
  2394. File “6147.cpp”; Line 29
  2395. Error:   internal error: file cpp.c line 3380
  2396.  
  2397. Workaround:
  2398.  
  2399. Ignore the spurious internal error and correct the source code.
  2400. ----------------------------------------------------------------------------
  2401. ••Defect Number: 6149, THINK C/C++, Symantec C/C++ for MPW
  2402.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2403. The compiler generates spurious errors when initializing members of an anonymous union in a
  2404. class:
  2405.  
  2406. class foo {
  2407.     union {     // anonymous unions add their members to the enclosing scope
  2408.         const int i;
  2409.         const double x;
  2410.     };
  2411.     foo(int anInt) : i(anInt) { }
  2412.     foo(double aDouble) : x(aDouble) { }
  2413. };
  2414.  
  2415. NB: the draft standard is sufficiently vague about this issue that there may not be a right
  2416. answer.
  2417. ----------------------------------------------------------------------------
  2418.     Product: THINK C/C++
  2419. ----------------------------------------------------------------------------
  2420. ••Defect Number: 6154, THINK C/C++
  2421.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2422. The compiler generates an excess stack frame when optimizing for space and not using function
  2423. calls for inlines. Disassembly of the following example will show this.
  2424.  
  2425. struct Simple 
  2426.  long value;  
  2427.  Simple(long value) : value(value) {};
  2428.  long AddOne();
  2429.  };
  2430.  
  2431. long Simple::AddOne()
  2432. {
  2433.  return value+1;
  2434. }
  2435.  
  2436. long main()
  2437. {
  2438.  Simple s(1); 
  2439.  s = s.AddOne(); 
  2440.  return s.value;
  2441. }
  2442. ----------------------------------------------------------------------------
  2443.     Product: THINK C/C++, Symantec C/C++ for MPW
  2444. ----------------------------------------------------------------------------
  2445. ••Defect Number: 6163, THINK C/C++, Symantec C/C++ for MPW
  2446.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2447. The following code generates an internal error after generating a valid diagnostic regarding an
  2448. access control violation:
  2449.  
  2450. class B
  2451. {
  2452. public:
  2453.     B(int ii) : i(ii) { }
  2454.     B() : i(0) { }
  2455. protected:
  2456.     int i;
  2457. };
  2458.     
  2459. class C : virtual private B
  2460. {
  2461. public:
  2462.     C(int ii) : B(ii) { }
  2463.     //C(){};
  2464. };
  2465.     
  2466. class D : public C
  2467. {
  2468. public:
  2469.     D(){ }        //Error:   internal error: file cpp.c line 3365 
  2470. };
  2471.  
  2472. Yields :
  2473. File “6163.cpp”; Line 21
  2474. Error:   member 'B::B' of class 'D' is not accessible
  2475.  
  2476. File “6163.cpp”; Line 21
  2477. Error:   internal error: file cpp.c line 3380
  2478.  
  2479. Workaround:
  2480.  
  2481. Ignore the internal error and correct the source code using the valid diagnostic.
  2482. ----------------------------------------------------------------------------
  2483. ••Defect Number: 6164, THINK C/C++, Symantec C/C++ for MPW
  2484.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2485. /* Generated error:   member 'b::nest' of class 'b' is not accessible
  2486.  * Protected member of private base class can be made accessible as
  2487.  * protected member of derived class with access declaration.  */
  2488.  
  2489.   class b{ protected: class nest {}m; };
  2490.   class c : private b{ protected:b::nest;};
  2491. ----------------------------------------------------------------------------
  2492. ••Defect Number: 6165, THINK C/C++, Symantec C/C++ for MPW
  2493.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2494. Nested type names aren't correctly adjusted by access declarations when referenced in function
  2495. scope. Eg:
  2496.  
  2497.     struct C {
  2498.         struct C_nest { };
  2499.     };
  2500.     
  2501.     struct D : private C {
  2502.     public:
  2503.         C::C_nest;
  2504.     };
  2505.  
  2506.     void f()
  2507.     {
  2508.         D::C_nest n;    // Error: member C::C_nest of type D is not accessible
  2509.     }
  2510. ----------------------------------------------------------------------------
  2511. ••Defect Number: 6166, THINK C/C++, Symantec C/C++ for MPW
  2512.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2513. /*  A friend or a member function of a derived class can access a 
  2514.   *  protected static member of a base class. */
  2515.  
  2516.   class A{ protected: static int i; };    
  2517.   class B : public A { public: friend class C; };
  2518.   class C { public: void f2(void); };
  2519.      
  2520.   void C::f2(void) { A::i++;  }   // Error:   member 'A::i' of class 'A' is not accessible
  2521. ----------------------------------------------------------------------------
  2522. ••Defect Number: 6167, THINK C/C++, Symantec C/C++ for MPW
  2523.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2524. /*    Static function members should be able to access public inherited protected members */
  2525.  
  2526.    class B { protected: static int i2; };
  2527.    class D : public B { public: static void f4(void); };
  2528.      void D::f4(void){ B::i2=0; }        //Error:   member 'B::i2' of class 'B' is not accessible
  2529. ----------------------------------------------------------------------------
  2530. ••Defect Number: 6168, THINK C/C++, Symantec C/C++ for MPW
  2531.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2532. /*  Nested class names are not defined in their own, or subsequent inner, scopes. */
  2533.    struct s {
  2534.      class c{ public:int c::*pm;};    //Error:   'c' must be a class name preceding '::'
  2535.    };
  2536. ----------------------------------------------------------------------------
  2537. ••Defect Number: 6169, THINK C/C++, Symantec C/C++ for MPW
  2538.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2539. /*  A reference to a volatile can be initialized with either volatile or a plain.
  2540.       The following code should only give a warning.  */
  2541.     int i = 2;
  2542.       volatile int &rvi2 = i;       //Error:   non-const reference initialized to temporary
  2543.  
  2544. ----------------------------------------------------------------------------
  2545.     Product: THINK C/C++
  2546. ----------------------------------------------------------------------------
  2547. ••Defect Number: 6172, THINK C/C++
  2548.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2549. The compiler can't find the correct overloaded function when an overloaded function is used as an
  2550. argument to another overloaded function. Eg:
  2551.  
  2552.     struct Z {
  2553.         void f(void (*)(int));
  2554.         void f(int);
  2555.     };
  2556.     
  2557.     void g(char);
  2558.     void g(int);
  2559.     
  2560.     void main()
  2561.     {
  2562.         Z z;
  2563.         z.f(g);     // Error: no match for function f()
  2564.     }
  2565.  
  2566. Workaround:
  2567.  
  2568. Reverse the order of overloaded function declarations so the desired overloaded function occurs
  2569. first. Above, reverse the order of the declarations of g().
  2570. ----------------------------------------------------------------------------
  2571. ••Defect Number: 5510, THINK C/C++
  2572.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2573. The compiler incorrectly allows a class declared with the __machdl keyword to be declared inside
  2574. another class declaration.
  2575.  
  2576.    class __machdl foo { }               
  2577.    class bar : public foo { short x; }
  2578.    class baz { bar quux; }              // should only allow bar *quux
  2579. ----------------------------------------------------------------------------
  2580. ••Defect Number: 5555, THINK C/C++
  2581.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2582. The compiler is position sensitive with regards to some modifiers. Each of the declarations below
  2583. should be allowed.
  2584.  
  2585.         class Foo {
  2586.         public:
  2587.                virtual void f();        // OK
  2588.                void virtual g();        // Compile error
  2589.         };
  2590.  
  2591. Workaround:
  2592.  
  2593. Always specify the 'virtual' modifier first.
  2594. ----------------------------------------------------------------------------
  2595. ••Defect Number: 5859, THINK C/C++
  2596.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2597. The compiler incorrectly mangles functions with the same name in different subscopes (best shown
  2598. with an example):
  2599.  
  2600. int main()
  2601. {
  2602.     {
  2603.         struct A {
  2604.             int a;
  2605.             void f() {
  2606.                 if(a<10) {
  2607.                     f();
  2608.                     ++a;
  2609.                 }
  2610.            };
  2611.         };
  2612.         A x;
  2613.         x.f();
  2614.     }
  2615.  
  2616.     {
  2617.         struct A{
  2618.             int a;
  2619.             void f() {
  2620.                 if(a<10) {
  2621.                     f();
  2622.                     ++a;
  2623.                 }
  2624.             };
  2625.         };
  2626.         A x;
  2627.         x.f();
  2628.     }
  2629.  
  2630.     return 0;
  2631. }
  2632. ----------------------------------------------------------------------------
  2633. ••Defect Number: 6148, THINK C/C++
  2634.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2635. Code resources that have static objects with constructors aren't handled properly. Code is
  2636. generated for the static construction function, but that function is never called.
  2637. ----------------------------------------------------------------------------
  2638.     Product: THINK C/C++, Symantec C/C++ for MPW
  2639. ----------------------------------------------------------------------------
  2640. ••Defect Number: 6165, THINK C/C++, Symantec C/C++ for MPW
  2641.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2642. Nested type names aren't correctly adjusted by access declarations when referenced in function scope. Eg:
  2643.  
  2644.     struct C {
  2645.         struct C_nest { };
  2646.     };
  2647.     
  2648.     struct D : private C {
  2649.     public:
  2650.         C::C_nest;
  2651.     };
  2652.  
  2653.     void f()
  2654.     {
  2655.         D::C_nest n;    // Error: member C::C_nest of type D is not accessible
  2656.     }
  2657. ----------------------------------------------------------------------------
  2658. ••Defect Number: 6179, THINK C/C++, Symantec C/C++ for MPW
  2659.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2660. Certain loop expressions can cause an internal error in CGcod.c, line 320. An example is:
  2661.  
  2662.     void f()
  2663.     {
  2664.         int j, k;
  2665.         int *p;
  2666.     
  2667.         while (j > !*p)
  2668.             k = !*p || *p;
  2669.     }
  2670.  
  2671. Workaround:
  2672.  
  2673. Turning on the global optimizer should fix the problem.
  2674. ----------------------------------------------------------------------------
  2675. ••Defect Number: 6184, THINK C/C++, Symantec C/C++ for MPW
  2676.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2677. The compiler doesn't produce the correct return type for new expressions that return pointer to
  2678. member types. Eg:
  2679.     void f()
  2680.     {    
  2681.         struct X { int i; };    
  2682.         int X::**px = new int X::*;  // Error: cannot implicitly convert from: int * to: int X::**
  2683.     }
  2684.  
  2685. Workaround:
  2686.  
  2687. Introduce a typedef for the desired type, and apply operator new() to that instead. Eg:
  2688. void f()
  2689. {
  2690.     struct X { int i;};
  2691.     typedef int X::*pmi;
  2692.     int X::**px = new(pmi);
  2693. }
  2694. ----------------------------------------------------------------------------
  2695. ••Defect Number: 6185, THINK C/C++, Symantec C/C++ for MPW
  2696.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2697. Using operator new() for multidimensional arrays that have constructors produces an incorrect
  2698. type result. Eg:
  2699.  
  2700.     struct X {
  2701.         X();
  2702.     };
  2703.     
  2704.     void f()
  2705.     {
  2706.         X (*p1)[2] = new X[3][2];  // Error: cannot implicitly convert from: X* to: X(*)[2]
  2707.     }
  2708.  
  2709. Workaround:
  2710.  
  2711. Cast the result of operator new() to the desired type, or remove the object's constructor.
  2712. ----------------------------------------------------------------------------
  2713. ••Defect Number: 6186, THINK C/C++, Symantec C/C++ for MPW
  2714.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2715. When specifying too many storage class specifiers for member functions, the error message is not
  2716. always clear.  As in:
  2717.  
  2718.   class
  2719.      {
  2720.   public:
  2721.       int virtual inline g(int i){};// should give same error as below
  2722.       int inline virtual f(int i){};//storage class illegal in this context: ok
  2723.      };
  2724.  
  2725. Which produces different error messages depending on the order of the declaration.  Errors are:
  2726. File “6186.cpp”; Line 4
  2727. Error:   ';' expected
  2728.  
  2729. File “6186.cpp”; Line 5
  2730. Error:    storage class is illegal in this context
  2731.  
  2732. Workaround:
  2733.  
  2734. When the ; expected error message is received, suspect that perhaps too many storage specifiers
  2735. have been used.
  2736. ----------------------------------------------------------------------------
  2737. ••Defect Number: 6187, THINK C/C++, Symantec C/C++ for MPW
  2738.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2739. Virtual functions cannot be declared with the inline specifier as in:
  2740.  
  2741.   class
  2742.      {
  2743.   public:
  2744.       int inline virtual f(int i){};//storage class illegal in this context
  2745.      };
  2746.  
  2747. Which should be allowed.
  2748.  
  2749. Workaround:
  2750.  
  2751. Leave the inline specifier off the virtual function when declaring it inside the class body.  It
  2752. will still be treated as inline.
  2753. ----------------------------------------------------------------------------
  2754. ••Defect Number: 6190, THINK C/C++, Symantec C/C++ for MPW
  2755.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2756. There is a problem declaring const pointers to members.  As in:
  2757.  
  2758.  struct A {int j;};
  2759.  int A::* const cpm;  // Error:   identifier or '( declarator )' expected
  2760.  
  2761. Workaround:
  2762.  
  2763. Do not declare pointers to members as const.
  2764. ----------------------------------------------------------------------------
  2765.     Product: THINK C/C++
  2766. ----------------------------------------------------------------------------
  2767. ••Defect Number: 6195, THINK C/C++
  2768.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2769. In certain cases, not all of the lines in a C++ program are able to be used for single stepping
  2770. as they should be.  As in:
  2771.  
  2772. #include <iostream.h>
  2773. #include <fstream.h>
  2774. #include <stdlib.h>
  2775.  
  2776. void main()
  2777. {
  2778.     ofstream outFile("copy.out", ios::out);
  2779.     
  2780.     if (!outFile)
  2781.     {
  2782.         cerr << "Cannot open" << endl;
  2783.         exit(-1);
  2784.     }
  2785. }
  2786.  
  2787. which does not have a diamond on the if statement and does not stop on the cerr statement when
  2788. single stepping or setting a breakpoint.
  2789. ----------------------------------------------------------------------------
  2790. ••Defect Number: 6204, THINK C/C++
  2791.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2792. The debugger does not display the values of virtual base classes when displaying a class object.
  2793. As in:
  2794.  
  2795. struct X {
  2796.     int i;
  2797. };
  2798. struct Y : virtual X {
  2799.     int j;
  2800. };
  2801.  
  2802. void main()
  2803. {
  2804.     Y y;
  2805.     y.i = 1;
  2806.     y.j = 2;        // j is visible in the debugger, but i isn't
  2807. }
  2808.  
  2809. Workaround:
  2810.  
  2811. 1. Make sure that the options are set to allow dataview function calls in the THINK project
  2812. manager options dialog box
  2813. 2. Cast the sub-class as in:
  2814. (X *) &y
  2815. This will allow the values of X to be displayed.
  2816.  
  2817. ----------------------------------------------------------------------------
  2818.     Product: THINK C/C++, Symantec C/C++ for MPW
  2819. ----------------------------------------------------------------------------
  2820. ••Defect Number: 6205, THINK C/C++, Symantec C/C++ for MPW
  2821.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2822. The compiler does not produce a sensible error message for the following code fragment:
  2823.  
  2824. // test.cpp
  2825. void foo(Bar *p);
  2826.  
  2827. It produces an error about a missing ')' and should complain about Bar being undefined.
  2828. ----------------------------------------------------------------------------
  2829. ••Defect Number: 6217, THINK C/C++, Symantec C/C++ for MPW
  2830.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2831. Certain complicated expressions cause the compiler to produce an internal error as in:
  2832.  
  2833. void f(int *p)
  2834. {
  2835.     int j = 0;
  2836.  
  2837.     while (j >  (!( *p ) || ( *p )) )
  2838.         j =  (!( *p ) || ( *p )) ;
  2839. }
  2840.  
  2841. Which produces:
  2842. File “6217.cpp”; Line 10
  2843. Error:   internal error: file ::CG:CGcod.c line 320
  2844.  
  2845. Workaround:
  2846.  
  2847. Simplify expressions in cases where this internal error is received.
  2848. ----------------------------------------------------------------------------
  2849.     Product: Symantec C/C++ for MPW, THINK C/C++
  2850. ----------------------------------------------------------------------------
  2851. ••Defect Number: 5261, Symantec C/C++ for MPW, THINK C/C++
  2852.   Problem Area: SymC++ Compiler      Type: Crash
  2853. Optimiser crash with multiple inheritance.
  2854. The following compiles ok unless the optimiser is on. Then it crashes with an internal error in
  2855. CGcod.c line 318.  
  2856.     class Mummy { virtual void mumProc(); };
  2857.     class Daddy { virtual void dadProc() = 0; };
  2858.     void wantDaddy( Daddy * );
  2859.  
  2860.     class Baby : public Mummy, public Daddy {
  2861.         Baby();
  2862.         virtual void dadProc();
  2863.     };
  2864.  
  2865.     Baby::Baby() {
  2866.         wantDaddy( this );
  2867.         wantDaddy( this );
  2868.     }
  2869.  
  2870. Workaround:
  2871.  
  2872. If the order is changed so that Baby inherits from Daddy first, Mummy second, it works.
  2873. ----------------------------------------------------------------------------
  2874.     Product: Symantec C/C++ for MPW
  2875. ----------------------------------------------------------------------------
  2876. ••Defect Number: 5429, Symantec C/C++ for MPW
  2877.   Problem Area: SymC++ Compiler      Type: Crash
  2878. Problem with  PascalObject.  This file compiles and links, but dies with a bus error when  you
  2879. run it. 
  2880.  
  2881. scpp temp1.cp
  2882. link {sclibraries}SCMainCpp.a.o temp1.cp.o {Libraries}Runtime.o {Libraries}Interface.o
  2883. {Libraries}ObjLib.o -o Temp
  2884.  
  2885. /* temp1.cp */
  2886. #include <Types.h>
  2887.  
  2888. class X : PascalObject {
  2889.     int xi;    
  2890.     virtual void A(int i);
  2891.     virtual int B(void);
  2892. };
  2893.  
  2894. void main (void)
  2895. {
  2896.     X* x;
  2897.     int i;
  2898.     double f;    
  2899.     x->A(5);    
  2900.     long j = (i = 9) * (f = 1.2);    
  2901.     i = x->B();
  2902. }
  2903.  
  2904. void X::A(int i)
  2905. {
  2906.     xi = i;
  2907. }
  2908.  
  2909. int X::B(void)
  2910. {
  2911.     return xi;
  2912. }
  2913. ----------------------------------------------------------------------------
  2914. ••Defect Number: 6160, Symantec C/C++ for MPW
  2915.   Problem Area: SymC++ Compiler      Type: Crash
  2916. There is a problem using Pascal Objects outside of MacApp with the scpp compiler.  The following
  2917. SIOW program demonstrates the problem.  It will crash on the call to the virtual function.
  2918.  
  2919. #include <stdio.h>
  2920. #include <types.h>
  2921.  
  2922. class __pasobj A
  2923. {
  2924.  void hello  (void);
  2925.  virtual void goodbye(void);
  2926. };
  2927. void A::hello()
  2928. {
  2929.  printf("hello world\n");
  2930. }
  2931. void A::goodbye()
  2932. {
  2933.  printf("goodbye world\n");
  2934. }
  2935. void main(void)
  2936. {
  2937.  A *a = new A; 
  2938.  a->hello  ();
  2939.  Debugger();
  2940.  a->goodbye();
  2941. }
  2942. ----------------------------------------------------------------------------
  2943.     Product: Symantec C/C++ for MPW, THINK C/C++
  2944. ----------------------------------------------------------------------------
  2945. ••Defect Number: 4520, Symantec C/C++ for MPW, THINK C/C++
  2946.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2947. Compiler fails to emit an error message when a destructor is declared const.
  2948. ----------------------------------------------------------------------------
  2949. ••Defect Number: 4521, Symantec C/C++ for MPW, THINK C/C++
  2950.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2951. Compiler fails to emit an error message when a destructor is declared volatile.
  2952. ----------------------------------------------------------------------------
  2953. ••Defect Number: 4743, Symantec C/C++ for MPW, THINK C/C++
  2954.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2955. Debug information is only generated for the last line of the following source.   Debug
  2956. information should be generated for each line. This problem occurs with the optimizer off.  The
  2957. right hand side expression need not be a constant expression; function calls have the same
  2958. effect.
  2959.  
  2960. typedef unsigned char bitfield;
  2961.  
  2962. struct {
  2963.     unsigned    b0  : 1;
  2964.     unsigned    b1  : 1;
  2965.     unsigned    b2  : 1;
  2966.     unsigned    b3  : 1;
  2967.     unsigned    b4  : 1;
  2968.     unsigned    b5  : 1;
  2969.     unsigned    b6  : 1;
  2970.     unsigned    b7  : 1;
  2971. } bits;
  2972.  
  2973. void main()
  2974. {                   
  2975.     bits.b0 = 1;
  2976.     bits.b1 = 1;
  2977.     bits.b2 = 1;
  2978.     bits.b3 = 1;
  2979.     bits.b4 = 1;
  2980.     /* ... */
  2981. }                   // breakpoint here
  2982. ----------------------------------------------------------------------------
  2983.     Product: Symantec C/C++ for MPW
  2984. ----------------------------------------------------------------------------
  2985. ••Defect Number: 4786, Symantec C/C++ for MPW
  2986.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  2987. Declaring data static affects the compiler's ability to catch segment overflows.  Static
  2988. declarations which would cause a segment overflow cause the linker to produce an error message of
  2989. the following form:
  2990.  
  2991. ### While reading file "test.c.o"
  2992. ### Link: Error: Bad repetition count for data module. (Error 42) x (2) 
  2993.    <Bad object file or compiler error.> 
  2994.  
  2995. If the data is not declared static,  error messages of the following form are generated.  This is
  2996. the correct error message to be generated in either case.
  2997.  
  2998. ### While reading file "test.c.o"
  2999. ### Link: Error: 16-bit reference offset out of range. (Error 114)  at $0005A in main
  3000.  
  3001. Workaround:
  3002.  
  3003. Remove static data declarations that will create more than 32K of data or use the -model far data
  3004. option.
  3005. ----------------------------------------------------------------------------
  3006. ••Defect Number: 4879, Symantec C/C++ for MPW
  3007.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3008. When compiled with optimizations, the following source code causes a erroneous warning message
  3009. from the SCPP and SC compilers: #Warning 12: variable 'x' used before set
  3010.  
  3011. void main( void )
  3012. {
  3013.    struct s{unsigned long i25:25; unsigned int i1:1;
  3014.       unsigned long i27:27,i26:26;} x;
  3015.       
  3016.    x.i25 = x.i27 = x.i26 = 110;
  3017.  }
  3018.  
  3019. Workaround:
  3020.  
  3021. Ignore the warning.
  3022. ----------------------------------------------------------------------------
  3023. ••Defect Number: 4995, Symantec C/C++ for MPW
  3024.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3025. The SC and SCPP compilers will not accept segment names that begin with a numeric character in
  3026. #pragma segment directives.
  3027.  
  3028. ----------------------------------------------------------------------------
  3029. ••Defect Number: 5356, Symantec C/C++ for MPW
  3030.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3031. Building a MacApp application with Symantec C++ for MPW produces many Lib warnings about
  3032. duplicate code.  These warnings are correct; there is in fact duplicate code generated when
  3033. MABuild is run. 
  3034.  
  3035. Workaround:
  3036.  
  3037. We have added a -d switch to the MABuild script in the current version to suppress these
  3038. warnings.  This is only a temporary fix for this problem.
  3039. ----------------------------------------------------------------------------
  3040. ••Defect Number: 5385, Symantec C/C++ for MPW
  3041.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3042. "SpinCursor" needs to be called more often from the SCpp optimizer and from the code generator.
  3043. The cursor is frozen during a long code generation and the machine appears to be dead.
  3044. ----------------------------------------------------------------------------
  3045. ••Defect Number: 5645, Symantec C/C++ for MPW
  3046.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3047. A code generation error produced by the SCPP compiler is demonstrated in the MacApp source file
  3048. UMacAppUtilities.cp.  The function IsColorPort() always returns false, even if it is passed a
  3049. color port.  The code generated by the following line in isColorPort() is incorrect:
  3050.  
  3051.     return ((((CGrafPtr)port)->portVersion) & 0xC000) == 0x0000C000;
  3052.  
  3053. SCpp generates code that sign extends the left side of the == to 0xFFFFC000,  and then compares
  3054. that to 0x0000C000. 
  3055.  
  3056. Workaround:
  3057.  
  3058. Replace the line:
  3059.     return ((((CGrafPtr)port)->portVersion) & 0xC000) == 0x0000C000;
  3060. with:
  3061.     return ((((CGrafPtr)port)->portVersion) & 0xFFFFC000) == 0xFFFFC000;
  3062. ----------------------------------------------------------------------------
  3063. ••Defect Number: 5907, Symantec C/C++ for MPW
  3064.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3065. Symantec C++ for MPW does not merge duplicate strings that occur in the same file. 
  3066. ----------------------------------------------------------------------------
  3067.     Product: Symantec C/C++ for MPW, THINK C/C++
  3068. ----------------------------------------------------------------------------
  3069. ••Defect Number: 6015, Symantec C/C++ for MPW, THINK C/C++
  3070.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3071. The C++ compiler causes an erroneous link error to be produced in the following situation:  there
  3072. is a header file declaring a class which declares a static const member of the same class type
  3073. and a constructor:
  3074.  
  3075. class A
  3076. {
  3077. public:
  3078.     A();
  3079.     static const A foo;
  3080. };
  3081.  
  3082. There are two source files which which include this header.  One contains the definition for the
  3083. static member and the constructor.  The other contains a main routine which references the static
  3084. member.
  3085.  
  3086. file 1:
  3087.  
  3088. const A A::foo;
  3089. A::A(){}
  3090.  
  3091. file 2:
  3092.  
  3093. void main()
  3094. {
  3095.     const A& a = A::foo;
  3096. }
  3097.  
  3098. An erroneous link error is produced, indicating that A::foo, referenced from file 2, is not
  3099. defined.
  3100. ----------------------------------------------------------------------------
  3101. ••Defect Number: 6120, Symantec C/C++ for MPW, THINK C/C++
  3102.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3103. The C++ compiler produces an internal error in file ::CG:CGcs.c line 153 compiling the following
  3104. code fragment.  This occurs only when the optimizer is off.
  3105.  
  3106. inline   void * SGXWADDR(unsigned short x) {
  3107.    return (void *)(((unsigned long)x<<1)+0x80000000); }
  3108. extern "C" {
  3109.    void panic(short); 
  3110. }
  3111. #define sems_allocated (*(unsigned short *)(SGXWADDR(1)))
  3112. class semaphore
  3113.   {
  3114.   void   operator delete(void *);
  3115.   };
  3116. void   semaphore::operator delete(void * p) {
  3117.   if (sems_allocated-- == 0) panic(1);
  3118. }
  3119. ----------------------------------------------------------------------------
  3120. ••Defect Number: 6121, Symantec C/C++ for MPW, THINK C/C++
  3121.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3122. The C++ compiler produces an internal error in file CGelem.c line 2116 compiling the following
  3123. code fragment.  This occurs only when the optimizer is on.
  3124.  
  3125. void * const NIL_ = ((void*)0x00000000); 
  3126. class dlink {      // doubly linked list element
  3127.   public:
  3128.   dlink *next, *prev;
  3129.   void unlink(void) {}
  3130.   };
  3131. inline int isNoneOrDamaged(dlink *p) {
  3132.   return ((void*)((unsigned long)p & -2UL) == NIL_); }
  3133. class semaphore 
  3134.   {
  3135.   dlink locker;
  3136.   void   clear_locker(void) { 
  3137.      if (! isNoneOrDamaged(locker.next))
  3138.         locker.unlink();
  3139.      }
  3140.   public:
  3141.      ~semaphore(void);
  3142.   };
  3143.   semaphore::~semaphore(void) {
  3144.   clear_locker();
  3145.   }
  3146. ----------------------------------------------------------------------------
  3147. ••Defect Number: 6122, Symantec C/C++ for MPW, THINK C/C++
  3148.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3149. An erroneous error is flagged for a pointer to a member in a class template.   The following code
  3150. fragment gives the erroneous error "tomni must be a class name preceding ::".
  3151.  
  3152. template <class T>
  3153. class tomni
  3154.     {
  3155.     T tomni::*pm; //tomni must be a class name preceeding ::
  3156.     };
  3157.  
  3158. tomni<int>;
  3159. ----------------------------------------------------------------------------
  3160. ••Defect Number: 6151, Symantec C/C++ for MPW, THINK C/C++
  3161.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3162. The C++ compiler fails to flag as an error a call to a non-const overload of the () operator if
  3163. the object is a declared const object. It works correctly for operator [] and operator +.
  3164.  
  3165.  class foo
  3166.   {
  3167.     int data;
  3168.   public:
  3169.     int operator[](int ignored) 
  3170.     {
  3171.       return data;
  3172.     }
  3173.     int operator()(int ignored)
  3174.     {
  3175.       return data;
  3176.     }
  3177.     int operator+(int ignored)
  3178.     {
  3179.       return data;
  3180.     }
  3181.   };
  3182.  
  3183.   void main( void )
  3184.   {
  3185.     const foo c;
  3186.  
  3187.     c[1];   // correctly flags this
  3188.     c(1);   // should flag an error here too
  3189.     c+1;    // correctly flags this
  3190.   }
  3191. ----------------------------------------------------------------------------
  3192. ••Defect Number: 6152, Symantec C/C++ for MPW, THINK C/C++
  3193.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3194. In argument matching, references should resolve to the closest parent.  In the following code
  3195. fragment, 
  3196.  
  3197. struct A{};
  3198. struct B:A{};
  3199. struct C:B{};
  3200.  
  3201. void f(A &a);
  3202. void f(B &b);
  3203.  
  3204. void main() {
  3205. C c;    f(c); }
  3206.  
  3207. the call to f(c) should be resolved to f(B &b).  Instead the following error is produced:
  3208.  
  3209. Error:ambiguous reference to function
  3210. Had: f(Aref)
  3211. and: f(Bref)
  3212.  
  3213. Workaround:
  3214.  
  3215. Perform an explicit cast to insure that the reference is resolved.  In the example above, change
  3216. f(c) to  f((B) c).
  3217. ----------------------------------------------------------------------------
  3218.     Product: Symantec C/C++ for MPW
  3219. ----------------------------------------------------------------------------
  3220. ••Defect Number: 6175, Symantec C/C++ for MPW
  3221.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3222. SCPP cannot find nested header files specified by pathnames in the following situation:
  3223. 1. Create a test folder outside of the MPW folder, called test.
  3224. 2. Put the following 3 files in test:
  3225.  
  3226. test.cc:
  3227.      #include "::test:what.h"
  3228.  
  3229. what.h:
  3230.      #include "::test.stuff.h"
  3231.  
  3232. stuff.h:
  3233.      #define BLAHBLAH
  3234.  
  3235. 3. Set the current directory to the test folder.
  3236. 4. SCpp test.cc -o test.obj
  3237.  
  3238. Produces:
  3239. Fatal error: unable to open input file '::test:stuff.h'
  3240.  
  3241. Workaround:
  3242.  
  3243. Removing "::test:" from the #include line in either test.cc OR what.h prevents the error from
  3244. occurring. Also, if the test folder is inside the MPW folder, the include files are both found. 
  3245. ----------------------------------------------------------------------------
  3246. ••Defect Number: 4523, Symantec C/C++ for MPW
  3247.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3248. A static member of a local class has no linkage; it cannot be defined.  SCPP does not flag an
  3249. error on the line indicated in the code fragment below.
  3250.  
  3251. void ign(void*);
  3252. int main()
  3253.     {
  3254.     class x {
  3255.     public:
  3256.         static int f(); 
  3257.         int j;
  3258.         };
  3259.     x xa;
  3260.     int x::f() { return 0; }; // should be an error: attempt to define static member local
  3261.  
  3262.     ign(&xa);
  3263.     return xa.f();
  3264.     }
  3265. ----------------------------------------------------------------------------
  3266. ••Defect Number: 5263, Symantec C/C++ for MPW
  3267.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3268. The SCPP compiler reports syntax errors and warnings for class templates in template
  3269. implementation files as being in the file from which the template file is included.  The line
  3270. number reported is correct but the file name is incorrect.
  3271.  
  3272. Workaround:
  3273.  
  3274. Preprocess the file in which the error is reported and then compile this preprocessed file.  The
  3275. error will be reported correctly for the preprocessed file.
  3276. ----------------------------------------------------------------------------
  3277.     Product: Symantec C/C++ for MPW, THINK C/C++
  3278. ----------------------------------------------------------------------------
  3279. ••Defect Number: 5322, Symantec C/C++ for MPW, THINK C/C++
  3280.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3281. The C++ compiler allows a static data member for a class to be initialized at class scope without
  3282. flagging an error.  This is illegal according to the ARM.  An error will occur at link time if
  3283. the code includes a static data member initialized at class scope.
  3284. ----------------------------------------------------------------------------
  3285.     Product: Symantec C/C++ for MPW
  3286. ----------------------------------------------------------------------------
  3287. ••Defect Number: 5324, Symantec C/C++ for MPW
  3288.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3289. The compiler issues two copies of the same warning when a non const reference is initialized to a
  3290. temporary.  In this example, the compiler converts a short to an int before passing an int & to
  3291. the member function. 
  3292.  
  3293. void CalledFunction(int & myInt)
  3294. {
  3295.     myInt++;
  3296. };
  3297. void main()
  3298. {
  3299.     short myShort = 0;
  3300.     CalledFunction(myShort);
  3301. };
  3302. ----------------------------------------------------------------------------
  3303. ••Defect Number: 5970, Symantec C/C++ for MPW
  3304.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3305. The compiler currently produces incorrect output of SYM information for an incomplete class
  3306. definition.
  3307. ----------------------------------------------------------------------------
  3308. ••Defect Number: 5971, Symantec C/C++ for MPW
  3309.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3310. The compiler does not limit itself to outputting type info only for referenced types.  This may
  3311. result in increased size of .o  and SYM files.
  3312. ----------------------------------------------------------------------------
  3313. ••Defect Number: 6021, Symantec C/C++ for MPW
  3314.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3315. SCPP produces a code generation error when compiling the following code fragment with the
  3316. optimizer on. The code generated for the statement "s[i] = c;" is incorrect.  The  code calls
  3317. operator[], but does not store c in the result returned by operator[].  An optimizer might be
  3318. able to do this if it knew that operator[] has no side effects, but the optimizer shouldn't assume this.
  3319.  
  3320. class myString 
  3321. {
  3322. public:
  3323.     int GetLength() const;
  3324.     char operator[](int position) const;
  3325. };
  3326.  
  3327. class myStringSubclass : public myString
  3328. {
  3329. public:
  3330.     virtual char& operator[](int position);
  3331. };
  3332.  
  3333. class myString255 : public myStringSubclass
  3334. {    
  3335. public:
  3336.     myuString255(const char *items);
  3337. };
  3338.  
  3339. void main () {
  3340.     int i;
  3341.     myString255 s("myString255");
  3342.     for (i=0; i<s.GetLength(); i++)
  3343.         {
  3344.             char c = s[i];
  3345.             s[i] = c;   // code gen problem occurs here
  3346.         }
  3347. }
  3348. ----------------------------------------------------------------------------
  3349. ••Defect Number: 6218, Symantec C/C++ for MPW
  3350.   Problem Area: SymC++ Compiler      Type: Incorrect Functionality
  3351. Certain pascal functions may generate an internal error if temporaries need to be implicitly
  3352. created for expressions in the return.
  3353.  
  3354. class myClass {
  3355.  pascal CPoint GetDesktopCoordinate(const VPoint& nextPoint);
  3356. };
  3357.  
  3358. pascal CPoint myClass::GetDesktopCoordinate(const VPoint& nextPoint) {
  3359.   VPoint theMouse = nextPoint;
  3360.   return VPtToPt(theMouse);
  3361. }/* GetDesktopCoordinate */
  3362.  
  3363. Workaround:
  3364.  
  3365. Replace the return line with:
  3366.  
  3367. CPoint c = VPtToPt(theMouse);
  3368. return c;
  3369. ----------------------------------------------------------------------------
  3370. ----------------------------------------------------------------------------
  3371. Problem Area: Rez
  3372. ----------------------------------------------------------------------------
  3373.     Product: THINK C/C++
  3374. ----------------------------------------------------------------------------
  3375. ••Defect Number: 5573, THINK C/C++
  3376.   Problem Area: Rez      Type: Incorrect Functionality
  3377. Running Rez on a .r file containing many huge arrays of data took over 20 minutes, vs. 30 seconds
  3378. for MPW Rez. 
  3379. ----------------------------------------------------------------------------
  3380. ••Defect Number: 5851, THINK C/C++
  3381.   Problem Area: Rez      Type: Incorrect Functionality
  3382. Rez incorrectly assumes an array of only 2 elements of 1 byte instead of 6 bytes for each element
  3383. in the following example:
  3384.  
  3385. type 'try ' {
  3386.    array[2] {
  3387.    unsigned hex byte;
  3388.    unsigned hex byte;
  3389.    unsigned hex byte;
  3390.    unsigned hex byte;
  3391.    unsigned hex byte;
  3392.    fill byte;
  3393.    };
  3394. };
  3395.  
  3396. resource 'try ' (128) {
  3397.    {
  3398.     0xC3,
  3399.     0x19,
  3400.     0xF4, /* reported error here */
  3401.     0xE4,
  3402.     0xD8,  
  3403.     0xC3,
  3404.     0x19,
  3405.     0xF4,
  3406.     0xE4,
  3407.     0xD8
  3408.    }
  3409. };
  3410. ----------------------------------------------------------------------------
  3411. ••Defect Number: 5853, THINK C/C++
  3412.   Problem Area: Rez      Type: Incorrect Functionality
  3413. Rez is unable to compile resources with an array of cases, when the size of an array element is
  3414. computed using a begin and end label. The size is being set to zero instead of the size of that
  3415. array element.   Example:
  3416.  
  3417. Start:
  3418.  key byte = rezType;
  3419.  fill byte;
  3420.  integer = (End[$$ArrayIndex(aName)]-Start[$$ArrayIndex(aName)]) >> 3;
  3421.  /* other information */
  3422. End:
  3423. ----------------------------------------------------------------------------
  3424. ••Defect Number: 5893, THINK C/C++
  3425.   Problem Area: Rez      Type: Incorrect Functionality
  3426.  Rez generates an internal error if it encounters this in a .r file:
  3427.    
  3428.           INCLUDE "Test" 'ICN#' (0) AS 'ICN#' (1,purgeable);  // internal error,  
  3429.  
  3430. Workaround:
  3431.  
  3432. Remove purgeable; do not put anything after (1).
  3433. ----------------------------------------------------------------------------
  3434. ••Defect Number: 5955, THINK C/C++
  3435.   Problem Area: Rez      Type: Incorrect Functionality
  3436. include "File" 'rsrc' (id) as 'rsrc' (id + 1); fails. This is a serious problem for AOCE
  3437. templates.
  3438.  
  3439. ----------------------------------------------------------------------------
  3440. ----------------------------------------------------------------------------
  3441. Problem Area: Debugger
  3442. ----------------------------------------------------------------------------
  3443.     Product: THINK C
  3444. ----------------------------------------------------------------------------
  3445. ••Defect Number: 2357, THINK C
  3446.   Problem Area: Debugger      Type: Incorrect Functionality
  3447. Stepping through a call to OpenPicture in the debugger will cause the Debugger to crash. 
  3448.  
  3449. Workaround:
  3450.  
  3451. Set a breakpoint on the next statement after the call and run to the breakpoint.
  3452. ----------------------------------------------------------------------------
  3453. ••Defect Number: 2751, THINK C
  3454.   Problem Area: Debugger      Type: Incorrect Functionality
  3455. Running a project with the Debugger when the clipboard (deskscrap) contains data over 1 Megabyte,
  3456. can cause the Debugger to become unstable.  
  3457.  
  3458. Workaround:
  3459.  
  3460. In order to test Copy and Paste with large amounts of data in your projects, you may need to turn
  3461. the Debugger off.
  3462. ----------------------------------------------------------------------------
  3463.     Product: THINK C/C++
  3464. ----------------------------------------------------------------------------
  3465. ••Defect Number: 4760, THINK C/C++
  3466.   Problem Area: Debugger      Type: Crash
  3467. The following steps will cause the machine to hang:  Run a program which puts up an alert box,
  3468. with the debugger enabled.  When the alert box comes up, hit command-shift-period and then hit
  3469. the ok button in the alert.  The machine hangs.  It was reproduced  on a Quadra 700, using system
  3470. 7.1 with the following program. 
  3471.  
  3472. void ToolBoxInit (void);
  3473. void ToolBoxInit ()
  3474. {
  3475.     InitGraf (&thePort);
  3476.     InitFonts ();
  3477.     InitWindows ();
  3478.     InitMenus ();
  3479.     TEInit ();
  3480.     InitDialogs (nil);
  3481.     InitCursor ();  
  3482. }
  3483. main ()
  3484. {
  3485.     ToolBoxInit();
  3486.     Alert(128, nil);
  3487. }
  3488. ----------------------------------------------------------------------------
  3489. ••Defect Number: 5780, THINK C/C++
  3490.   Problem Area: Debugger      Type: Crash
  3491. With  68881, 68020, no nfp, Virtual Memory on,  stepping through this with the Debugger will
  3492. cause a bus error, or the debugger just quits:  
  3493.  
  3494. #include <math.h>
  3495. int main()
  3496. {
  3497.  sin(1.0);
  3498.  return;
  3499. }
  3500.  
  3501. ----------------------------------------------------------------------------
  3502. ••Defect Number: 5408, THINK C/C++
  3503.   Problem Area: Debugger      Type: Incorrect Functionality
  3504. The debugger is in an odd state when there are expressions saved in the data window. When the
  3505. project is run, the debugger highlights the Data window instead of the Source window, and the Go
  3506. button is highlit. Single stepping is disabled unless the user selects "Clear all expressions",
  3507. hits "go", and starts the run over.
  3508.  
  3509. // Debug-test.cp
  3510. void MyFunction(unsigned char c, unsigned char keyCode)
  3511. {
  3512. c = keyCode;
  3513. };
  3514.  
  3515. void main()
  3516. {
  3517. MyFunction('a',0xd1);
  3518. }
  3519.  
  3520. Workaround:
  3521.  
  3522. Select "Clear all expressions", then hit "go", and start over.
  3523. ----------------------------------------------------------------------------
  3524. ••Defect Number: 5594, THINK C/C++
  3525.   Problem Area: Debugger      Type: Incorrect Functionality
  3526. Breakpoints cannot be saved if they are in #include'd files regardless of whether "Always Save
  3527. Session" is on or "Save All" is selected in the file menu.
  3528. ----------------------------------------------------------------------------
  3529. ••Defect Number: 5998, THINK C/C++
  3530.   Problem Area: Debugger      Type: Incorrect Functionality
  3531. Bug when trying to display a class member value in the Data window with an example program linked
  3532. with oopsDebug/++.  Typing in the following expression: 
  3533.      shape ? shape->GetClassID () : 'NULL'  
  3534. generates error:  ◊◊ contains a function call ◊◊
  3535. The debugger hangs upon exiting to shell.
  3536.      
  3537. ----------------------------------------------------------------------------
  3538. ••Defect Number: 6003, THINK C/C++
  3539.   Problem Area: Debugger      Type: Incorrect Functionality
  3540. If the file below is compiled with C++ and run in the debugger, single stepping reveals that DDP
  3541. is assigned a constant and still shows as 0 in the Dataview window, while pv will get the correct
  3542. value of 0xFEEDFACE. 
  3543.  
  3544. typedef pascal short (*OptionsDefProc)(short msg, DialogPtr dp, EventRecord *event, short *item,
  3545. void *param);
  3546. static Handle options[2];                
  3547. static OptionsDefProc DDP;                
  3548. void *pv;
  3549.  
  3550. void main(void )
  3551. {
  3552.     DDP = (OptionsDefProc) 0xFEEDFACE;
  3553.     pv = DDP;
  3554. }
  3555. ----------------------------------------------------------------------------
  3556. ••Defect Number: 6109, THINK C/C++
  3557.   Problem Area: Debugger      Type: Incorrect Functionality
  3558. If you try to debug a file whose translator is missing (i.e. it was compiled at some earlier
  3559. time, but now the translator is gone), the debugger source window just comes up with an empty
  3560. window.  An error message to the effect "No translator installed for this file" should appear in
  3561. the source window.
  3562. ----------------------------------------------------------------------------
  3563. ••Defect Number: 4951, THINK C/C++
  3564.   Problem Area: Debugger      Type: Incorrect Functionality
  3565. You can't permanently position the Debugger's source code window within MenuBarHeight of the top
  3566. of a second screen.
  3567. ----------------------------------------------------------------------------
  3568. ••Defect Number: 5045, THINK C/C++
  3569.   Problem Area: Debugger      Type: Incorrect Functionality
  3570. Changing the project type to a non source debuggable type does not remove the Debug checkmark
  3571. even though debugging is not possible.
  3572. ----------------------------------------------------------------------------
  3573. ----------------------------------------------------------------------------
  3574. Problem Area: Editor
  3575. ----------------------------------------------------------------------------
  3576.     Product: THINK C/C++
  3577. ----------------------------------------------------------------------------
  3578. ••Defect Number: 5483, THINK C/C++
  3579.   Problem Area: Editor      Type: Data Loss or Corruption
  3580. Compiling a file with a syntax error with an external editor which locks the data fork of the
  3581. file may cause unexpected behavior in the external editor.  The project manager returns the
  3582. fileRefNum used in the other application instead of the refnum that OpenDF returned when the file 
  3583. was opened to obtain the line the error occurred on. This results in the file being closed without 
  3584. the knowledge of the other application.
  3585. ----------------------------------------------------------------------------
  3586. ••Defect Number: 5166, THINK C/C++
  3587.   Problem Area: Editor      Type: Incorrect Functionality
  3588. There is a consistent markers drift in source files that is not due to the files being edited
  3589. with any editor. They seem to move up in the file over time.
  3590. ----------------------------------------------------------------------------
  3591. ••Defect Number: 5618, THINK C/C++
  3592.   Problem Area: Editor      Type: Incorrect Functionality
  3593. The Think Project Manager has a problem handling files with > 32K lines. Such a file can be saved
  3594. to disk, but cannot be scrolled past the first windowfull of lines. Doing "select all" followed
  3595. by "copy" or "paste" does nothing, but the user is given no notification of this.  
  3596. ----------------------------------------------------------------------------
  3597. ••Defect Number: 4257, THINK C/C++
  3598.   Problem Area: Editor      Type: Incorrect Functionality
  3599. The text editor in the Think Project occasionally has inverted text synchronization problems
  3600. during scrolling.  Similar problems have been noted with Programmer's Editor Package.
  3601. ----------------------------------------------------------------------------
  3602. ••Defect Number: 4258, THINK C/C++
  3603.   Problem Area: Editor      Type: Incorrect Functionality
  3604.  You may get an update glitch if you do cmd-V, cmd-B, cmd-z. (Paste, Balance, Undo).
  3605. ----------------------------------------------------------------------------
  3606. ••Defect Number: 5431, THINK C/C++
  3607.   Problem Area: Editor      Type: Incorrect Functionality
  3608. If a multi-file batch search is performed on a string foo, selecting the first line in the Search
  3609. Results window and hitting "Enter" will cause the file containing that string to open up with the
  3610. appropriate occurrence selected.  However, if the next occurrence happens to be on the same line
  3611. as the first,  "Go To Next Match" does not select  the next occurrence.  The last match stays
  3612. selected.
  3613. ----------------------------------------------------------------------------
  3614. ••Defect Number: 6219, THINK C/C++
  3615.   Problem Area: Editor      Type: Incorrect Functionality
  3616. Duplicate markers shouldn't be created.  When the user selects a procedure name, and chooses
  3617. Mark, and an marker with the same name already exists, the old marker should be replaced (upon
  3618. confirmation by the user).
  3619. ----------------------------------------------------------------------------
  3620. ----------------------------------------------------------------------------
  3621. Problem Area: Headers
  3622. ----------------------------------------------------------------------------
  3623.     Product: THINK C/C++
  3624. ----------------------------------------------------------------------------
  3625. ••Defect Number: 6108, THINK C/C++
  3626.   Problem Area: Headers      Type: Incorrect Functionality
  3627. SetupA4.h contains functions for SetUpA4 and RestoreA4 that are declared inline for the C++
  3628. compiler. Problem is, if "use function calls for inlines" is on, the SetUpA4 mechanisms no longer
  3629. work. If they are changed to macro definitions,ie.
  3630.  
  3631. #define SetUpA4 { asm(0x2F0C); ... // instead of inline void SetUpA4(void) { ...
  3632.  
  3633. everthing works regardless of the compiler settings.
  3634.  
  3635. Workaround:
  3636.  
  3637. Use macro for inline definition.
  3638. ----------------------------------------------------------------------------
  3639. ----------------------------------------------------------------------------
  3640. Problem Area: Libraries
  3641. ----------------------------------------------------------------------------
  3642.     Product: THINK C/C++
  3643. ----------------------------------------------------------------------------
  3644. ••Defect Number:
  3645. 6002, THINK C/C++
  3646.   Problem Area: Libraries      Type: Crash
  3647. 68000 crash: 
  3648. New_by_name doesn't work on 68000 machines.  NewClassDemo++ demonstrates the problem; when
  3649. running on a Mac Classic, it produces an address error in CStdPopupPane in the popup menus demo
  3650. dialog.  
  3651.  
  3652. Workaround:
  3653.  
  3654. The following untested fix was suggested by a user and is not necessarily endorsed by Symantec:
  3655. Replace the "verify we've found a class info record" section in cp_new_by_name.cp with the
  3656. following:
  3657. ;
  3658. ;verify we've found a class info record
  3659. ;
  3660. ;- at entry, p = start of found name plus 2
  3661. ;- verify by looking back before name. First check for '.', then look
  3662. ;for 'CLASINFO'
  3663. ;
  3664. ;;
  3665. movea.l p, a0
  3666. sub.l   #12, a0 ; here starts the fix
  3667. move.l  (a0)+,d0
  3668. move.l  (a0)+,d1
  3669. and.l   #0x00FFFFFF,d0
  3670. cmpi.w  #'O.',(a0)
  3671. bne.s   @1
  3672. cmpi.l  #'SINF',d1
  3673. bne.s   @1
  3674. cmpi.l  #'\0CLA',d0
  3675. bne.s   @1
  3676. subq.l  #8, a0  ; skip length byte
  3677. ----------------------------------------------------------------------------
  3678. ••Defect Number: 4354, THINK C/C++
  3679.   Problem Area: Libraries      Type: Incorrect Functionality
  3680. IOStream Library:
  3681. Failbit is not set when an input value overflows its variable, i.e:
  3682.  
  3683. #include <iostream.h>
  3684. void main () {
  3685. int d;
  3686. cin >> d;             // give it 887234786234. It won't fail.
  3687. if (cin.rdstate() & ios::failbit)
  3688.     cout << "Bad input\n";
  3689. }
  3690. ----------------------------------------------------------------------------
  3691. ••Defect Number: 6079, THINK C/C++
  3692.   Problem Area: Libraries      Type: Incorrect Functionality
  3693. The function CRMGetToolResource is prototyped in CommResources.h but is not in the CommToolbox
  3694. Library.
  3695. ----------------------------------------------------------------------------
  3696.     Product: THINK C/C++, Symantec C/C++ for MPW
  3697. ----------------------------------------------------------------------------
  3698. ••Defect Number: 6150, THINK C/C++, Symantec C/C++ for MPW
  3699.   Problem Area: Libraries      Type: Incorrect Functionality
  3700. Run this program and enter a couple numbers separated by carriage returns, and hit control-D. The
  3701. output contains two copies of the last number entered, indicating that when it hits the EOF it
  3702. incorrectly returns true once before returning false.  
  3703. #include <iostream.h>
  3704. #include <console.h>
  3705.  
  3706. void main() {
  3707.     int n = 0, i;
  3708.     int temp;
  3709.     int a[50];
  3710.  
  3711.     cshow(stdout);
  3712.     while (cin >> temp)     // bug: (cin >> foo) true when should be false?
  3713.         a[n++] = temp;
  3714.  
  3715.     for (i = 0; i < n; i++)
  3716.         cout << a[i] << endl;
  3717. }
  3718. ----------------------------------------------------------------------------
  3719.     Product: Symantec C/C++ for MPW, THINK C/C++
  3720. ----------------------------------------------------------------------------
  3721. ••Defect Number: 6153, Symantec C/C++ for MPW, THINK C/C++
  3722.   Problem Area: Libraries      Type: Incorrect Functionality
  3723. The va_arg macro in stdarg.h is not fully parenthesized.  The result is that va_arg() does not
  3724. allow its result to be a struct.  For example the following code
  3725.  
  3726. #include <stdarg.h>
  3727.  
  3728.  struct X {int f(int n); };
  3729.  
  3730. void f_132p51(int i, ...)
  3731. {
  3732.          void *ap;
  3733.         va_arg(ap, X).f(-1);  // error here
  3734. }
  3735.  
  3736. results in this error:
  3737. Error: not a struct or union type
  3738.  
  3739. Workaround:
  3740.  
  3741. Changing
  3742. #define va_arg(p, type)            *(* (type **) &p)++
  3743. to
  3744. #define va_arg(p, type)            (*(* (type **) &p)++)
  3745. in stdarg.h will fix this problem.
  3746.  
  3747. ----------------------------------------------------------------------------
  3748.     Product: Symantec C/C++ for MPW
  3749. ----------------------------------------------------------------------------
  3750. ••Defect Number: 6202, Symantec C/C++ for MPW
  3751.   Problem Area: Libraries      Type: Incorrect Functionality
  3752. There is a problem printing pascal strings due to a bug in SCLibraries:SCSrcLibC:printf.c.
  3753.  
  3754. case 'P':   /* pascal string */
  3755.    s = va_arg(pargs,char *);
  3756. // pargs += sizeof(char *);
  3757.  
  3758. The line: 'pargs += sizeof(char *);' causes printf to skip 4 bytes of any arguments following a
  3759. %P argument. 
  3760.  
  3761. Workaround:
  3762.  
  3763. Comment the line out in printf.c to fix the problem.
  3764. ----------------------------------------------------------------------------
  3765. ----------------------------------------------------------------------------
  3766. Problem Area: Linker
  3767. ----------------------------------------------------------------------------
  3768.     Product: THINK C/C++
  3769. ----------------------------------------------------------------------------
  3770. ••Defect Number: 5785, THINK C/C++
  3771.   Problem Area: Linker      Type: Data Loss or Corruption
  3772. The code below is part of an attempt to create a code resource that would modify itself using a
  3773. pc-relative addressing mode. The linker is unable to complete the relocation and corrupts the
  3774. code in the final link. The linker should be modified to produce an error message under these
  3775. circumstances. 
  3776.  
  3777. void func(void);
  3778. void foo(void);
  3779.  
  3780. void main(void)
  3781. {
  3782.     *(long *)&foo = 1;      // generates bad code
  3783.     Debugger();             
  3784.     *(long *)&func = 1;     // as does this
  3785. }
  3786.  
  3787. void foo(void)
  3788. {
  3789.     asm {
  3790. extern func:
  3791.         dc.l    0
  3792.    }
  3793. }
  3794. ----------------------------------------------------------------------------
  3795. ----------------------------------------------------------------------------
  3796. Problem Area: TCL
  3797. ----------------------------------------------------------------------------
  3798.     Product: THINK Class Library
  3799. ----------------------------------------------------------------------------
  3800. ••Defect Number: 5692, THINK Class Library
  3801.   Problem Area: TCL      Type: Crash
  3802. If an object or subclass of CDialogText is gopher at the time the window which is its enclosure
  3803. is closed, the inherited::Dispose call will call BecomeGopher(FALSE), which will call Validate(),
  3804. which will attempt to read the contents of the macTE (calling CDialogText::GetTextString). The
  3805. macTE has already been disposed of and is no longer there, so this fails, causing the program to
  3806. bomb with a bus error. 
  3807.  
  3808. Workaround:
  3809.  
  3810. The following workaround was suggested by a user.  It has not been tested by Symantec and is not
  3811. necessarily the solution that will be used to fix the problem:
  3812. Change:
  3813. void CDialogText::GetTextString( StringPtr aString)
  3814. {
  3815.    short length = Min( (**macTE).teLength, 255);
  3816.    BlockMove( *(**macTE).hText, &aString[1], length);
  3817.    aString[0] = length;
  3818. }  /* CDialogText::GetTextString */
  3819.  
  3820. to:
  3821. void CDialogText::GetTextString( StringPtr aString)
  3822. {
  3823.    short length;
  3824.    if (macTE)  {
  3825.       length = Min((**macTE).teLength, 255);
  3826.       BlockMove( *(**macTE).hText, &aString[1], length);
  3827.       aString[0] = length;
  3828.    } else {
  3829.       aString[0] = 0;
  3830. }
  3831. }
  3832. ----------------------------------------------------------------------------
  3833. ••Defect Number: 5840, THINK Class Library
  3834.   Problem Area: TCL      Type: Crash
  3835. CSizeBox::Activate will fail if it is called and the window which encloses it is not yet the
  3836. current port. 
  3837.  
  3838. Workaround:
  3839.  
  3840. The following workaround was suggested by a user.  It has not been tested by Symantec and is not
  3841. necessarily the solution that will be used to fix the problem:
  3842.  
  3843. In CSizeBox::Activate(), replace the call to InvalRect() with a call to Refresh().
  3844. ----------------------------------------------------------------------------
  3845. ••Defect Number: 2507, THINK Class Library
  3846.   Problem Area: TCL      Type: Incorrect Functionality
  3847. The EqualMem routine can only compare even length data (except for a single byte, which it
  3848. special-cases), and it cannot operate on more than 32K of data at a time. 
  3849. ----------------------------------------------------------------------------
  3850. ••Defect Number: 2734, THINK Class Library
  3851.   Problem Area: TCL      Type: Incorrect Functionality
  3852. The menuID in the MenuInfo record can be different from its MENU resource ID. The code in the
  3853. CPopupMenu::PopupSelect method assumes that they are the same.  When they are different the wrong
  3854. menu pops up.
  3855.  
  3856. Workaround:
  3857.  
  3858. The following workaround was suggested by a user.  It has not been tested by Symantec and is not
  3859. necessarily the solution that will be used to fix the problem:
  3860. Adding the line indicated below will make CPopupMenu more robust:
  3861. void CPopupMenu::IPopupMenu( short aMenuID, CBureaucrat *aSupervisor,
  3862.     Boolean fAutoSelect, Boolean fMultiSelect)
  3863. {
  3864. ...
  3865.    if (!macMenu)    /* no it hasn't */
  3866.    {
  3867.    /* add the menu, but don't install into the menu list */
  3868.    gBartender->AddMenu( menuID, FALSE, 0);
  3869.    macMenu = gBartender->FindMacMenu( menuID);
  3870.    /* it better have been found now */
  3871.    FailNILRes( macMenu);
  3872.    (*macMenu)->menuID = menuID;    /*** THIS IS THE NEW LINE ***/
  3873.    }
  3874. ----------------------------------------------------------------------------
  3875. ••Defect Number: 3060, THINK Class Library
  3876.   Problem Area: TCL      Type: Incorrect Functionality
  3877. In the NewClassDemo (C only), follow these steps:
  3878. 1) Open a String Table Demo
  3879. 2) Scroll to the bottom of the list.
  3880. 3) Select the last one.
  3881. 4) Click the "Delete" button
  3882. Repeat 3 and 4 until there are no more items in the list and an assertion failure will occur:
  3883.  
  3884. "Assertion Failed: position.v<=bounds.bottom
  3885. "File CPanorama.c
  3886. "Line 182
  3887.  
  3888. which is in CPanorama::SetBounds.  Apparently the drawing area has become too small when the last
  3889. item is deleted, and no check has been made on its size before calling SetBounds.
  3890. ----------------------------------------------------------------------------
  3891. ••Defect Number: 3091, THINK Class Library
  3892.   Problem Area: TCL      Type: Incorrect Functionality
  3893. The CPanorama::Pagination method will print an additional horizontal or vertical strip if the
  3894. pixel extent of the CPanorama object is equal to the page width. The extra strip should not be
  3895. added if the extent is an even multiple of the page size.
  3896. ----------------------------------------------------------------------------
  3897. ••Defect Number: 3092, THINK Class Library
  3898.   Problem Area: TCL      Type: Incorrect Functionality
  3899. The CDocument::Notify method sets the dirty flag even if a NULL is passed for the task.
  3900. ----------------------------------------------------------------------------
  3901. ••Defect Number: 3106, THINK Class Library
  3902.   Problem Area: TCL      Type: Incorrect Functionality
  3903. The parameters aHEncl, aVEncl in all of the TCL Pane subclasses are declared short, although the
  3904. instance variables hEncl, vEncl are long. This makes it impossible to initialize a pane to a long
  3905. coordinate position.
  3906. ----------------------------------------------------------------------------
  3907. ••Defect Number: 3114, THINK Class Library
  3908.   Problem Area: TCL      Type: Incorrect Functionality
  3909. CApplication::Process1Event() uses 
  3910. aDAIsActive = IsSystemWindow((WindowPeek)FrontWindow());
  3911. to determine if a DA is active. This will not work for DA's that do not have windows (i.e. have
  3912. menus only).
  3913. ----------------------------------------------------------------------------
  3914. ••Defect Number: 4343, THINK Class Library
  3915.   Problem Area: TCL      Type: Incorrect Functionality
  3916. In CPrinter::OpenPrintMgr(),:if fCheckError is TRUE and an PrError returns an error, printMgrOpen
  3917. needs to be reset to false.
  3918. ----------------------------------------------------------------------------
  3919. ••Defect Number: 4344, THINK Class Library
  3920.   Problem Area: TCL      Type: Incorrect Functionality
  3921. CArrayPane::Dispose() does not cancel the dependency with its array.
  3922.  
  3923. Workaround:
  3924.  
  3925. The following workaround was suggested by a user.  It has not been tested by Symantec and is not
  3926. necessarily the solution that will be used to fix the problem.
  3927.  
  3928. Add the following lines after the opening brace of CArray::Dispose() to guarantee cancelling of
  3929. the dependency with the array:
  3930. if( itsArray )
  3931.     CancelDependency( itsArray );
  3932. ----------------------------------------------------------------------------
  3933. ••Defect Number: 4345, THINK Class Library
  3934.   Problem Area: TCL      Type: Incorrect Functionality
  3935. CDialogDirector::EndDialog() provides no way to avoid validation of a dialog when the user hits
  3936. cancel.
  3937.  
  3938. Workaround:
  3939.  
  3940. The following workaround was suggested by a user.  It has not been tested by Symantec and is not
  3941. necessarily the solution that will be used to fix the problem:
  3942.  
  3943. To avoid validation when the user hits cancel, hide the window.
  3944. Boolean CDialogDirector::EndDialog( long withCmd, Boolean fValidate)
  3945. {
  3946.    Boolean closeIt = TRUE;
  3947.    if (itsWindow)
  3948.    {
  3949.       if(withCmd==cmdCancel)    // To avoid validation of dialog
  3950.       {                           //text on a cancel, we hide the window.
  3951.          itsWindow->Hide();
  3952.          fValidate = FALSE;
  3953.       }
  3954.       if (fValidate)
  3955.          closeIt = Validate();
  3956.       if (closeIt)
  3957.         dismissCmd = withCmd;
  3958.       }
  3959.       return closeIt;
  3960.    }    /* CDialogDirector::EndDialog */
  3961. ----------------------------------------------------------------------------
  3962. ••Defect Number: 4349, THINK Class Library
  3963.   Problem Area: TCL      Type: Incorrect Functionality
  3964. Since CClipboard::DataSize() may generate an exception and some code (such as menu updating)
  3965. doesn't expect errors, it needs to have TRY/ENDTRY statements around its code and to just return
  3966. 0 if an error occurs.
  3967.  
  3968. ----------------------------------------------------------------------------
  3969. ••Defect Number: 5665, THINK Class Library
  3970.   Problem Area: TCL      Type: Incorrect Functionality
  3971. In the TinyEdit demo, no blinking caret appears when a new document is opened.  The caret appears
  3972. when the user begins typing, but disappears again after a carriage return.
  3973. ----------------------------------------------------------------------------
  3974. ••Defect Number: 5688, THINK Class Library
  3975.   Problem Area: TCL      Type: Incorrect Functionality
  3976. The call to SendBehind () in CFWDesktop::SelectWind() will only work if aWindow is a desk
  3977. accessory.
  3978.  
  3979. Workaround:
  3980.  
  3981. The following workaround was suggested by a user.  It has not been tested by Symantec and is not
  3982. necessarily the solution that will be used to fix the problem:
  3983.  
  3984. Change aWindow->macPort to aModal->macPort, in the call to SendBehind.
  3985. From CFWDesktop::SelectWind():
  3986. if (theWindow->IsFloating()) {      /* Select a floating window         */
  3987.    if (theWindow != topFloat) {    /* If this isn't the top float ...  */
  3988.       // TCL 1.1.3 11/30/92 BF
  3989.       aModal = GetLastModal(&anyModalsVisible);
  3990.       if (aModal)                 /* If there is a modal window       */
  3991.          /*   Put floating window behind it  */
  3992.          SendBehind(theWindow->macPort, aModal->macPort);  // CHANGED LINE
  3993.       else
  3994.          /*   Make it the front window       */
  3995.          BringToFront(theWindow->macPort);
  3996.          /*   Update our window list         */
  3997.          itsFloats->BringFront(theWindow);
  3998.          theWindow->Show();          /*   Make it visible, if necessary  */
  3999.          topFloat = theWindow;       /*   Mark it as the top float       */
  4000.          /* Suppress deactivate - normal     */
  4001.          /*   window remains "in front"      */
  4002.          CurDeactive = NULL;         //   TCL 1.1.3 11/30/92 BF
  4003.       }
  4004.    } else if (theWindow != topWindow) {
  4005. ----------------------------------------------------------------------------
  4006. ••Defect Number: 5712, THINK Class Library
  4007.   Problem Area: TCL      Type: Incorrect Functionality
  4008. In the CPaneBorder class, borderFlags is defined as a long as an instance variable, and as an
  4009. argument to all methods that use it except for IPaneBorder, which defines it as a short.  It
  4010. should be a long everywhere.
  4011. ----------------------------------------------------------------------------
  4012. ••Defect Number: 5724, THINK Class Library
  4013.   Problem Area: TCL      Type: Incorrect Functionality
  4014. The error handling code in CObject::SubclassResponsibility() should be an ASSERT or other type of
  4015. alert, rather than a DebugStr();
  4016.  
  4017. ----------------------------------------------------------------------------
  4018. ••Defect Number: 5749, THINK Class Library
  4019.   Problem Area: TCL      Type: Incorrect Functionality
  4020. NewClassDemo reveals the following bug: Type something, then save, then without doing anything
  4021. else continue typing. The Save command is disabled, since no new task was posted. 
  4022.  
  4023. Workaround:
  4024.  
  4025. The undo buffer needs to be reset (with a Notify(NULL)) after the save.
  4026. ----------------------------------------------------------------------------
  4027. ••Defect Number: 5793, THINK Class Library
  4028.   Problem Area: TCL      Type: Incorrect Functionality
  4029. There is a problem with CIconPane.cp with C++ only. The problem comes from the fact that the
  4030. toolbox call PlotCIconHandle() does not seem to modify the return code if no error occurs. This
  4031. is not a problem in Think C, since it pushes a 0 on the stack. C++, however, just decrements the
  4032. stack by two, then makes the call. This means that PlotCIconHandle() seems to return an error
  4033. code even if nothing bad happened, since it's just reading whatever garbage was left on the
  4034. stack.
  4035.  
  4036. Workaround:
  4037.  
  4038. The following workaround was suggested by a user.  It has not been tested by Symantec and is not
  4039. necessarily the solution that will be used to fix the problem:
  4040. This modification to the tcl_PlotCIconHandle() inline definition at the top of CIconPane.cp will
  4041. work with both C and C++:
  4042. /* Need to clear out the return value, because PlotCIconHandle doesn't seem to set it, so C++
  4043. call fails, because it just subtracts 2 from SP, rather than  pushing 0, as C does.
  4044. We add:
  4045. MOVEQ #$0, D0   ;0x7000
  4046. MOVE.W D0, $C(A7)   ;0x3f40, 0x000c
  4047. */
  4048. pascal OSErr tcl_PlotCIconHandle( Rect*, short, short, CIconHandle) = { 0x7000, 0x3f40, 0x000c,
  4049. 0x303C, 0x61F, tcl_IconDispatch};
  4050. ----------------------------------------------------------------------------
  4051. ••Defect Number: 5794, THINK Class Library
  4052.   Problem Area: TCL      Type: Incorrect Functionality
  4053. CSwitchboard:DoUpdate(), CSwitchboard::DoActivate() and CSwitchboard::DoDeactivate() have the
  4054. potential to call member with a NULL object, since EventToWindow() will return NULL for a non TCL
  4055. window.
  4056.  
  4057. w = EventToWindow(macEvent);      // this returns a NULL for nonTCL window!!
  4058. if (member(w, CWindow))           // causing member() to get a bus error
  4059. .....;
  4060.  
  4061.  
  4062. Workaround:
  4063.  
  4064. The following workaround was suggested by a user.  It has not been tested by Symantec and is not
  4065. necessarily the solution that will be used to fix the problem:
  4066. Change
  4067. w = EventToWindow(macEvent);      // this returns a NULL for nonTCL window!!
  4068. if (member(w, CWindow))           // causing member() to get a bus error
  4069. ...;
  4070.  
  4071. to:
  4072. w = EventToWindow(macEvent);      // this returns a NULL for nonTCL window!!
  4073. if (w && member(w, CWindow))      // checks for non-NULL, preventing crash
  4074. ...;
  4075. ----------------------------------------------------------------------------
  4076. ••Defect Number: 5926, THINK Class Library
  4077.   Problem Area: TCL      Type: Incorrect Functionality
  4078. CRunArray::FindSum() will crash with a divide by zero error on a CRunArray object whose first
  4079. members are zero, as when making a CTable's first row's height equal to zero.
  4080.  
  4081. Workaround:
  4082.  
  4083. The following workaround was suggested by a user.  It has not been tested by Symantec and is not
  4084. necessarily the solution that will be used to fix the problem:
  4085. In CArray::FindSum():
  4086. put
  4087. if (currRun->value!=0)
  4088. before the line
  4089.     currIndex -= (currSum - aSum -1) / currRun->value + 1;
  4090. ----------------------------------------------------------------------------
  4091. ••Defect Number: 5983, THINK Class Library
  4092.   Problem Area: TCL      Type: Incorrect Functionality
  4093. In CApplication::Idle()
  4094. The if statement 
  4095.     
  4096.     if (rainyDay != NULL) {
  4097.         DisposHandle(rainyDay);
  4098.     }
  4099. should read
  4100.     
  4101.     if (rainyDay != NULL) {
  4102.         DisposHandle(rainyDay);
  4103.         rainyDay = NULL;
  4104.     }
  4105. This affects execution in very low memory situations.
  4106.  
  4107. Workaround:
  4108.  
  4109. Change CApplication::Idle() as indicated above.
  4110. ----------------------------------------------------------------------------
  4111. ••Defect Number: 5984, THINK Class Library
  4112.   Problem Area: TCL      Type: Incorrect Functionality
  4113. In CDLOGDialog::IDLOGDialog()
  4114. After the line
  4115.     FailNILRes( dlogTemplate);
  4116.  
  4117. should be the following lines:
  4118.  
  4119.     savedState = HGetState( (Handle) dlogTemplate); // currently further down in the code.
  4120.     HNoPurge((Handle) dlogTemplate)                 // new addition
  4121.  
  4122. These changes prevent the possiblility of dlogTemplate being purged before it is locked and used
  4123. towards the end of the method code. This affects execution in very low memory situations.
  4124.  
  4125. Workaround:
  4126.  
  4127. Change CDLOGDialog::IDLOGDialog() as indicated above.
  4128. ----------------------------------------------------------------------------
  4129. ••Defect Number: 6028, THINK Class Library
  4130.   Problem Area: TCL      Type: Incorrect Functionality
  4131. At the top of the CCluster.cp file, in the comments for TCL 1.1 changes it notes that "CCluster
  4132. is now a superclass of CArray".  In fact the opposite is true, CCluster is a subclass of CArray.
  4133. ----------------------------------------------------------------------------
  4134. ••Defect Number: 6080, THINK Class Library
  4135.   Problem Area: TCL      Type: Incorrect Functionality
  4136. In CPane.cp, the comment for 1.1.3 changes claims that GetEnabled() and SetEnabled() methods have
  4137. been added but no such methods exist.
  4138. ----------------------------------------------------------------------------
  4139. ••Defect Number: 6093, THINK Class Library
  4140.   Problem Area: TCL      Type: Incorrect Functionality
  4141. The MAXLONG and MAXINT definitions conflict in files Values.h (Mac #includes) and Global.h (TCL
  4142. Core Classes). Global.h hard codes MAXINT and MAXLONG to 32767 and 0x7FFFFFFF. Values.h ties them
  4143. to sizeof(int) and sizeof(long).
  4144. ----------------------------------------------------------------------------
  4145. ••Defect Number: 6140, THINK Class Library
  4146.   Problem Area: TCL      Type: Incorrect Functionality
  4147. In the CBartender::SetMenuBarState() method, the line:
  4148.             oldState |= ((**(entry->macMenu)).enableFlags & 1) << i;
  4149. should read:
  4150.             oldState |= ((**(entry->macMenu)).enableFlags & 1) << n;
  4151.  
  4152. since i is the index into the Bartender's menu array (which includes both menu bar and
  4153. hierarchical menus), while n is the index of menu bar menus. The effect of this bug is that the
  4154. menu bar state isn't properly restored
  4155. after closing a modal dialog.
  4156. ----------------------------------------------------------------------------
  4157. ••Defect Number: 6161, THINK Class Library
  4158.   Problem Area: TCL      Type: Incorrect Functionality
  4159. gInBackground is NEVER initialized.  It is only set in CApplication::Suspend and Resume.
  4160. ----------------------------------------------------------------------------
  4161. ••Defect Number: 6220, THINK Class Library
  4162.   Problem Area: TCL      Type: Incorrect Functionality
  4163. The GetSteps() method in CEditText doesn't preserve the QuickDraw environment. It calls
  4164. GetTEFontInfo() so that it can GetFontInfo() but doesn't set the font back to what it was before.
  4165.  
  4166. ----------------------------------------------------------------------------
  4167. ----------------------------------------------------------------------------
  4168. Problem Area: UI & Environment
  4169. ----------------------------------------------------------------------------
  4170.     Product: THINK C
  4171. ----------------------------------------------------------------------------
  4172. ••Defect Number: 2645, THINK C
  4173.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4174. Some sort of warning should alert the user to the following unexpected behaviour : Given the
  4175. following project structure:
  4176.  
  4177.   MyProject ƒ:
  4178.     MyProject.π
  4179.     main.c
  4180.     TempFolder ƒ:
  4181.       dummy.c
  4182.  
  4183. If you open up main.c, and then use "Save As" to save it in the folder "TempFolder ƒ", the THINK
  4184. Project Manager *deletes* the old copy of main.c and writes a new one into the folder "TempFolder
  4185. ƒ". This is contrary to user expectations. If you use Save As to give a file a different name, it
  4186. doesn't remove the old file.
  4187.    This is partly understandable since the THINK Project Manager requires that there be no
  4188. duplicate filenames in two different trees.
  4189.  
  4190. ----------------------------------------------------------------------------
  4191. ••Defect Number: 5034, THINK C
  4192.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4193. #include "filename.h" does not work exactly as documented.  Note the double quotes.
  4194. The THINK Project Manager looks first in the referencing folder, then in the project tree, and
  4195. finally in the THINK Tree. 
  4196.  
  4197. This works as documented, EXCEPT when the referencing folder is in the THINK Tree.  In that case,
  4198. the THINK Project Manager looks first in the referencing folder, THEN in the THINK Tree, and
  4199. finally in the project tree.
  4200.  
  4201. Workaround:
  4202.  
  4203. Do not put project specific files in the THINK Project Manager tree.
  4204. ----------------------------------------------------------------------------
  4205. ••Defect Number: 4756, THINK C
  4206.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4207. On a German keyboard running system 7.1, command-period (cancel) does not work at all under the
  4208. debugger.  
  4209. ----------------------------------------------------------------------------
  4210.     Product: THINK C/C++
  4211. ----------------------------------------------------------------------------
  4212. ••Defect Number: 5236, THINK C/C++
  4213.   Problem Area: UI & Environment      Type: Crash
  4214. TPM crashes (address error) on a Centris 610 when launched from an AppleShare file server over
  4215. LocalTalk.  This is with all extensions except for AppleShare, Memory and Cache Switch (all
  4216. System Software things) disabled manually. 
  4217.  
  4218. Workaround:
  4219.  
  4220. Turning 040 caches off corrects the problem.
  4221. ----------------------------------------------------------------------------
  4222. ••Defect Number: 6066, THINK C/C++
  4223.   Problem Area: UI & Environment      Type: Crash
  4224. Open a project containing enough files so that the project window scroll bars are active (a TCL
  4225. project works well).  Select the project, hit END, and option-click on one of the arrows to
  4226. compress the project window.  Then hit HOME, END, HOME, END.  TPM will hang.
  4227. ----------------------------------------------------------------------------
  4228. ••Defect Number: 5755, THINK C/C++
  4229.   Problem Area: UI & Environment      Type: Crash
  4230. Unimplemented trap sometimes occurs in Add Files dialog under system 6.
  4231. ----------------------------------------------------------------------------
  4232. ••Defect Number: 3018, THINK C/C++
  4233.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4234. If "Confirm Saves" is off, closing the window of a file that's in a write-protected folder (i.e.
  4235. on a server) gives an "Unknown Error -5000" alert. (-5000 is an AppleShare privilege violation.)
  4236. The only way to close the window is to turn on "Confirm Saves", close the window, and click 
  4237. "discard changes". 
  4238. ----------------------------------------------------------------------------
  4239. ••Defect Number: 4045, THINK C/C++
  4240.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4241. Files should open on the same monitor as the project window.
  4242. ----------------------------------------------------------------------------
  4243. ••Defect Number: 4146, THINK C/C++
  4244.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4245. If a resource file named <projname>.rsrc is added to a project named <projname> so that it can be
  4246. double-clicked on in the project window, TPM says that resources are duplicated when the project
  4247. is brought up to date.   At the very least, TPM shouldn't allow the .rsrc file to be added in the
  4248. first place. At the very best, it should be able to handle this case when old-style projects are
  4249. being used.
  4250. ----------------------------------------------------------------------------
  4251. ••Defect Number: 4253, THINK C/C++
  4252.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4253. The Project Manager incorrectly allows you to add multi-segment projects to projects.
  4254. ----------------------------------------------------------------------------
  4255. ••Defect Number: 4584, THINK C/C++
  4256.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4257. When a project is run from within THINK Project Manager the resource flags (preload, locked,
  4258. etc.) of the segments of the application seem to be ignored. Therefore, a built application's
  4259. segments behave differently than the segments of a project run within the environment. This makes
  4260. it difficult to debug segmentation-related problems at the source level. (In fact, the default
  4261. segment flags CAUSE problems that modified flags could solve, like heap fragmentation, segments
  4262. getting loaded at the wrong time, etc.)
  4263. ----------------------------------------------------------------------------
  4264. ••Defect Number: 4699, THINK C/C++
  4265.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4266. There is an editor problem with scrolling selections into view. If a line is triple clicked, and
  4267. its left edge is not showing, it scrolls into view. If an item is double-clicked that extends
  4268. over the right edge, it too will scroll into view.  Instead, the current scroll selection should
  4269. be maintained.  
  4270. ----------------------------------------------------------------------------
  4271. ••Defect Number: 4919, THINK C/C++
  4272.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4273. There is no dependency between a .o file and a .v file for the .o converter. If a .v file is
  4274. changed, its .o is not re-compiled when the project is updated.
  4275.  
  4276. Workaround:
  4277.  
  4278. re-compile the .o file as soon as you've edited the .v file
  4279. ----------------------------------------------------------------------------
  4280. ••Defect Number: 5102, THINK C/C++
  4281.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4282. Choose New Project: the button to make it so is called Create when the dialog opens and as long
  4283. as one travels upwards in the folder hierarchy. But start traveling downwards and the button
  4284. changes to Save. It should change to Create again when a project name is entered. 
  4285. ----------------------------------------------------------------------------
  4286. ••Defect Number: 5109, THINK C/C++
  4287.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4288. If a project's rsrc file is open when an app is being built, TPM does everything except copy the
  4289. resources, yet doesn't notify the user that the resources weren't copied.
  4290.  
  4291. Workaround:
  4292.  
  4293. close .rsrc file before building apps
  4294. ----------------------------------------------------------------------------
  4295. ••Defect Number: 5146, THINK C/C++
  4296.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4297. When TinyEdit TCL program was built with low disk space (only 22K free when TPM attempted to load
  4298. MacTraps2)  the machine hung with the compilation progress window up. Got out with
  4299. cmd-option-escape.
  4300. TPM should check for low disk space, and put up an alert. 
  4301. ----------------------------------------------------------------------------
  4302. ••Defect Number: 5170, THINK C/C++
  4303.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4304. If an external editor is used, TPM closes the current project when user chooses Quit, but doesn't
  4305. always actually quit.
  4306. ----------------------------------------------------------------------------
  4307. ••Defect Number: 5249, THINK C/C++
  4308.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4309. When project windows are printed out, the resulting printout includes segment numbers but not
  4310. their names, as they appear in the actual window. 
  4311. ----------------------------------------------------------------------------
  4312. ••Defect Number: 5468, THINK C/C++
  4313.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4314. If a project includes another project that is locked, and the locked project is double-clicked in
  4315. the project window, a dialog box comes up in the Finder instead of in the TPM.
  4316. ----------------------------------------------------------------------------
  4317. ••Defect Number: 5528, THINK C/C++
  4318.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4319. There is a problem with header files in the project tree that have the same name as a file they
  4320. include in the THINK tree, for example a file called time.h in the project tree that includes
  4321. <time.h>. TPM says it can't open the file and then gets confused.
  4322. ----------------------------------------------------------------------------
  4323. ••Defect Number: 5575, THINK C/C++
  4324.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4325. With the "re-open files" option selected, the editor doesn't re-open the .h files that were left
  4326. open in the project. 
  4327. ----------------------------------------------------------------------------
  4328. ••Defect Number: 5587, THINK C/C++
  4329.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4330. If a source or include file cannot be found, the batch compilation stops with an alert. That
  4331. notice should go into the error list instead and the update should continue with the next source
  4332. file. 
  4333. ----------------------------------------------------------------------------
  4334. ••Defect Number: 5616, THINK C/C++
  4335.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4336. When projects are moved from one machine to another,  files in the project sometimes can't be
  4337. found when the project is updated, even when they are still in the project tree. 
  4338. ----------------------------------------------------------------------------
  4339. ••Defect Number: 5644, THINK C/C++
  4340.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4341. The string displayed in the first screen of the TPM about box should be "Symantec C++ for
  4342. Macintosh"  not just "Symantec C++".
  4343.  
  4344. ----------------------------------------------------------------------------
  4345. ••Defect Number: 5670, THINK C/C++
  4346.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4347. If a Run is done after a Remove Objects on a project containing multiple items, and the compile
  4348. is aborted with command-period, the compile stops but the Run is still attempted. A Link Errors
  4349. window may appear, depending upon the state the project is in.
  4350. ----------------------------------------------------------------------------
  4351. ••Defect Number: 5676, THINK C/C++
  4352.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4353. If the C++:Debugging option is changed from  "Report 1st few errors" to "Report all errors", 
  4354. every source in the project is recompiled during an Update.  
  4355. ----------------------------------------------------------------------------
  4356. ••Defect Number: 5777, THINK C/C++
  4357.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4358. When a batch search is resumed (command T), the progress window says "file n of 1" for each file
  4359. searched. Also, 1 or 2 lines at the top of the Search Results window get overwritten when an
  4360. interrupted batch search is resumed.
  4361. ----------------------------------------------------------------------------
  4362. ••Defect Number: 5897, THINK C/C++
  4363.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4364. If a "batch" compile is in progress it's sometimes necessary to keep pressing Cmd-period over and
  4365. over again to cancel the batch.  It then doesn't save the results of the compilation up to the
  4366. stopping point.
  4367. ----------------------------------------------------------------------------
  4368. ••Defect Number: 5922, THINK C/C++
  4369.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4370. If a file is mapped to the "None" translator, it can't be included in a multi-file search.  
  4371. ----------------------------------------------------------------------------
  4372. ••Defect Number: 5963, THINK C/C++
  4373.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4374. If an alias to an unmounted server is in the alias folder, the Finder will open the mount-server
  4375. dialog every time a project is opened or created.
  4376.  
  4377. Workaround:
  4378.  
  4379. Hitting cancel in the dialog allows the user to continue.
  4380. ----------------------------------------------------------------------------
  4381. ••Defect Number: 5967, THINK C/C++
  4382.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4383. Applescript support bug:  The 'compiled_at' and 'modified_at' properties are returned
  4384. appropriately,  but AppleScript can't do anything with them, complaining that an arithmetic 
  4385. operation is impossible because a value is too large. 
  4386. ----------------------------------------------------------------------------
  4387. ••Defect Number: 5972, THINK C/C++
  4388.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4389. Applescript bug: TPM doesn't deal with "every" at all, e.g.
  4390.     name of every segment of project document 1
  4391. gives a "some data was the wrong type" error. This disallows the very useful "repeat
  4392. with...in..." construct:
  4393.     repeat with seg in every segment of project document 1
  4394.         name of seg
  4395.     end repeat
  4396.  
  4397. Workaround:
  4398.  
  4399. use numeric-index loops, as shown in the examples supplied with TPM.
  4400. ----------------------------------------------------------------------------
  4401. ••Defect Number: 5974, THINK C/C++
  4402.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4403. AppleScript issue: GetData of most special classes fails. For instance, "source 1 of project
  4404. document 1" by itself gets a "descriptor type mismatch" error. It should just return an object
  4405. specifier representing the first source file.  I can't say:
  4406.     name of selection of project document 1
  4407.  
  4408. Workaround:
  4409.  
  4410.  use:   set x to selection of project document 1
  4411.            name of x
  4412. ----------------------------------------------------------------------------
  4413. ••Defect Number: 5980, THINK C/C++
  4414.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4415. On occasion, option-clicking in the title bar of a connected source file does not produce the
  4416. list of included header files. 
  4417.  
  4418. Workaround:
  4419.  
  4420. deactivate the source window in question and re-activate it, then try again
  4421. ----------------------------------------------------------------------------
  4422. ••Defect Number: 6017, THINK C/C++
  4423.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4424. If the TPM allows users to modify locked files, it should do two things:
  4425. - warn the user when opening locked files directly through the TPM, so the file can be unlocked
  4426. before editing.
  4427. - not allow the user to close a modified locked file without explicitly throwing away changes
  4428. made to the document.  If the user decides to save, the Save As dialog should be presented.
  4429. Alternatively, allow the user to open the file but not edit it, a la checked-out read only files.
  4430.  
  4431. ----------------------------------------------------------------------------
  4432. ••Defect Number: 6074, THINK C/C++
  4433.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4434. According to the Macintosh Human Interface Guidelines (p. 140), scroll bars in inactive windows
  4435. should not be drawn at all; instead, an empty box should be drawn where the scroll bar would
  4436. normally be drawn.
  4437. ----------------------------------------------------------------------------
  4438. ••Defect Number: 6102, THINK C/C++
  4439.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4440. Double-clicking on .o or library files in the project window produces the incorrect error message
  4441. "<some file>.o" cannot be opened because its translator is missing".  
  4442. ----------------------------------------------------------------------------
  4443. ••Defect Number: 6170, THINK C/C++
  4444.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4445. Update glitch:  compile a file containing these 3 lines:
  4446. int i;
  4447. ...
  4448. int j;
  4449.  
  4450. Select the three lines, select Compile errors window, hit Enter to select the error, deselect.
  4451. There are 2 leftover thin highlighted lines above and below the error.
  4452.  
  4453. ----------------------------------------------------------------------------
  4454. ••Defect Number: 4197, THINK C/C++
  4455.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4456. Apple event interface problem: Apple events for getting file info cannot go across networks,
  4457. since FSSpecs are local. The FSSpec should be replaced by an alias. 
  4458.  
  4459. ----------------------------------------------------------------------------
  4460. ••Defect Number: 4425, THINK C/C++
  4461.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4462. Even when "Confirm Project Updates" is not checked,    "Link..." asks if you want to bring
  4463. the project up-to-date. 
  4464. ----------------------------------------------------------------------------
  4465. ••Defect Number: 5378, THINK C/C++
  4466.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4467. There is an issue with Menu Sharing with Frontier, regarding having the target app in the
  4468. debugger receiving all 'KAHL' events. At the very least, the shared menus should be disabled
  4469. while debugging.
  4470. ----------------------------------------------------------------------------
  4471. ••Defect Number: 5452, THINK C/C++
  4472.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4473. Even with the Always Check File Dates option turned on in the TPM Preferences, source code
  4474. outside the project folder is not always checked during an Update or Make.  
  4475. ----------------------------------------------------------------------------
  4476. ••Defect Number: 5725, THINK C/C++
  4477.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4478. If Page Setup is chosen after installing new System software and launching a TPM project, nothing
  4479. happens.  An alert should come up telling the user to select a printer in the Chooser.
  4480. ----------------------------------------------------------------------------
  4481. ••Defect Number: 6115, THINK C/C++
  4482.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4483. Although TPM appears to remember the location of ".c" files that were aliased through the Aliases
  4484. folder, it seems to do an exhaustive search each time a ".h" file is requested that is contained
  4485. in one of the aliased folders, thus slowing down compiles.  
  4486. ----------------------------------------------------------------------------
  4487. ••Defect Number: 6214, THINK C/C++
  4488.   Problem Area: UI & Environment      Type: Incorrect Functionality
  4489. Many Standard Libraries files have a creation date later than the last modification date.  
  4490. ----------------------------------------------------------------------------
  4491. ----------------------------------------------------------------------------
  4492. Problem Area: SCCS
  4493. ----------------------------------------------------------------------------
  4494.     Product: THINK C/C++
  4495. ----------------------------------------------------------------------------
  4496. ••Defect Number: 4928, THINK C/C++
  4497.   Problem Area: SCCS      Type: Incorrect Functionality
  4498. When user tries to Checkout at the same time as someone else, a cryptic permissions error appears
  4499. instead of the friendly "Are you sure you want to keep waiting?" MPW Projector dialogs:
  4500. ### NameRevisions - Unable to open project "ProjectorDBs∫" in directory "Source:ProjectorDBs:".
  4501. # OS error -54 (Error message file not available)
  4502. ----------------------------------------------------------------------------
  4503. ••Defect Number: 4935, THINK C/C++
  4504.   Problem Area: SCCS      Type: Incorrect Functionality
  4505. When using Checkout To: another directory, the “Directory” button should select the directory
  4506. that you’re in, not the folder selected. Or, at least, there should be a way to select the
  4507. directory that you’re in, rather than have all
  4508. the buttons dim when you get to it.
  4509. ----------------------------------------------------------------------------
  4510. ••Defect Number: 4940, THINK C/C++
  4511.   Problem Area: SCCS      Type: Incorrect Functionality
  4512. There is no way in the SourceServer interface to remove a file from a project DB once it's in
  4513. there.
  4514.  
  4515. Workaround:
  4516.  
  4517. use MPW's DeleteRevisions -y
  4518. ----------------------------------------------------------------------------
  4519. ••Defect Number: 5057, THINK C/C++
  4520.   Problem Area: SCCS      Type: Incorrect Functionality
  4521. When a checked-out file is checked in, the task and comment fields are blank. They should default
  4522. to the text the user supplied when the file was checked out, rather than requiring re-entry of
  4523. the information.
  4524. ----------------------------------------------------------------------------
  4525. ••Defect Number: 5085, THINK C/C++
  4526.   Problem Area: SCCS      Type: Incorrect Functionality
  4527. Pressing Return in the Check In/Out dialogs presses the default button instead of entering a
  4528. return character into the text, as it does in MPW. 
  4529. ----------------------------------------------------------------------------
  4530. ••Defect Number: 5207, THINK C/C++
  4531.   Problem Area: SCCS      Type: Incorrect Functionality
  4532. The check out window incorrectly allows you to request a non-leaf version of a file modifiable
  4533. non-branch.
  4534. It should default to read-only.  In any case, if modifiable is selected, branch should be
  4535. automatically checkmarked (and the user shouldn't be able to turn it off).
  4536. ----------------------------------------------------------------------------
  4537. ••Defect Number: 5313, THINK C/C++
  4538.   Problem Area: SCCS      Type: Incorrect Functionality
  4539. When checking out source files from a ProjectorDB created with MPW 3.2, the source file is
  4540. recorded as checked out from a NULL user,  even though there was a user name in the Check Out
  4541. dialog.  Trying to check that file back using MPW is then impossible.
  4542. ----------------------------------------------------------------------------
  4543. ••Defect Number: 5682, THINK C/C++
  4544.   Problem Area: SCCS      Type: Incorrect Functionality
  4545. Using the command line to set the checkout directory (checkoutdir <pathname>) to the same path as
  4546. the current directory (which appears as the second item in the "Check out to: <directory>" popup
  4547. in the CheckOut dialog), causes the pathname to appear twice in a row in this popup menu
  4548. thereafter.
  4549. ----------------------------------------------------------------------------
  4550. ••Defect Number: 5885, THINK C/C++
  4551.   Problem Area: SCCS      Type: Incorrect Functionality
  4552. In the SourceServer CheckIn dialog, files which cannot be checked in (i.e. they are read only,
  4553. checked out by someone else or not found) should be dimmed.  
  4554. ----------------------------------------------------------------------------
  4555. ••Defect Number: 5886, THINK C/C++
  4556.   Problem Area: SCCS      Type: Incorrect Functionality
  4557. In the SourceServer CheckOut dialog, the icons in the revision view list are not updated when one
  4558. performs a checkout or an undo checkout.
  4559. ----------------------------------------------------------------------------
  4560. ••Defect Number: 5888, THINK C/C++
  4561.   Problem Area: SCCS      Type: Incorrect Functionality
  4562. If a file is checked in that cannot be found, the failure is silent; the user gets no warning
  4563. message or other notification that the file was not checked in.
  4564. ----------------------------------------------------------------------------
  4565. ••Defect Number: 5889, THINK C/C++
  4566.   Problem Area: SCCS      Type: Incorrect Functionality
  4567. If two projects are mounted and "set project" is done on the one that is not current,  the
  4568. project popup in the checkin dialog does not indicate the correct project.  If the popup is then
  4569. used to switch to the correct project, the icons in the list are not updated.
  4570. ----------------------------------------------------------------------------
  4571. ••Defect Number: 5890, THINK C/C++
  4572.   Problem Area: SCCS      Type: Incorrect Functionality
  4573. The task and comment fields in the checkout dialog should be dimmed when checking out read-only.
  4574. ----------------------------------------------------------------------------
  4575. ••Defect Number: 5947, THINK C/C++
  4576.   Problem Area: SCCS      Type: Incorrect Functionality
  4577. MPW Projector allows carriage returns in Checkout Info.  If such a Projector database is ported
  4578. to the TPM and opened in SourceServer, clicking on the INFO button in the CheckOut dialog where
  4579. the info contains a carriage return causes the popup menus to stop working, and displays only the
  4580. text in the window up to the CR.
  4581. ----------------------------------------------------------------------------
  4582. ••Defect Number: 5968, THINK C/C++
  4583.   Problem Area: SCCS      Type: Incorrect Functionality
  4584. In the Source Server checkout dialog,  the "By Name" popup pops up but doesn't work in the
  4585. revision view.  It should move up a level to the file view and then select the appropriate files.
  4586. ----------------------------------------------------------------------------
  4587. ••Defect Number: 6095, THINK C/C++
  4588.   Problem Area: SCCS      Type: Incorrect Functionality
  4589. If a file is changed and not saved and then checked in using "Check in <filename>", the changed
  4590. version gets checked in just as it should.  The changed file is now Read-only. However, if the
  4591. file is checked in with "Check in ...", the behavior is different: the changed file gets checked
  4592. in, and a read-only icon appears in the lower left, BUT if the file is closed, a dialog comes up
  4593. asking whether to save changes. And if the user says no, the read-only file actually gets changed
  4594. back to what it was before it was edited.
  4595. ----------------------------------------------------------------------------
  4596. ----------------------------------------------------------------------------
  4597. Problem Area: Utilities & Demos
  4598. ----------------------------------------------------------------------------
  4599.     Product: THINK C/C++
  4600. ----------------------------------------------------------------------------
  4601. ••Defect Number: 5744, THINK C/C++
  4602.   Problem Area: Utilities & Demos      Type: Incorrect Functionality
  4603. In the Vector demo, typing "vi.size()" or "nextLetter(c1)" into the Data window yields "illegal
  4604. instruction" or "bus error". 
  4605. ----------------------------------------------------------------------------
  4606. ••Defect Number: 5745, THINK C/C++
  4607.   Problem Area: Utilities & Demos      Type: Incorrect Functionality
  4608. Problems with the profiler and C++ methods:
  4609.    1) overloaded calls get chopped off with no way to distinguish them.
  4610.    2) mangled names show up in certain cases.
  4611.    
  4612. ----------------------------------------------------------------------------
  4613. End of Report.
  4614.